more experiments
This commit is contained in:
parent
5bfe72553f
commit
e6c02baf95
2 changed files with 17 additions and 4 deletions
|
@ -21,9 +21,9 @@ void Keyer::run()
|
|||
{
|
||||
case State::Wait:
|
||||
if (left_paddle_pressed())
|
||||
state = State::LeftPaddlePressed;
|
||||
state = State::Dit;
|
||||
break;
|
||||
case State::LeftPaddlePressed:
|
||||
case State::Dit:
|
||||
printf(".");
|
||||
|
||||
if (left_paddle_pressed())
|
||||
|
@ -31,12 +31,24 @@ void Keyer::run()
|
|||
else
|
||||
state = State::Wait;
|
||||
break;
|
||||
case State::Dah:
|
||||
printf("-");
|
||||
++numElements;
|
||||
if (numElements == 3)
|
||||
{
|
||||
numElements = 0;
|
||||
if (left_paddle_pressed())
|
||||
state = State::InterCharSpace;
|
||||
else
|
||||
state = State::Wait;
|
||||
}
|
||||
break;
|
||||
|
||||
case State::InterCharSpace:
|
||||
printf("(.)");
|
||||
|
||||
if (left_paddle_pressed())
|
||||
state = State::LeftPaddlePressed;
|
||||
state = State::Dit;
|
||||
else
|
||||
state = State::Wait;
|
||||
break;
|
||||
|
|
|
@ -7,7 +7,8 @@ public:
|
|||
enum class State
|
||||
{
|
||||
Wait,
|
||||
LeftPaddlePressed,
|
||||
Dit,
|
||||
Dah,
|
||||
InterCharSpace,
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue