123456789101112131415161718192021222324252627282930313233343536373839 |
- #include <Automaton.h>
- Atm_led dot, dash;
- Atm_timer stepTimer;
- Atm_step step;
- const int pin = 4;
- const int dotTime = 100;
- const int dashTime = 300;
- const int waitTime = 200;
- const int longwaitTime = 300;
- const int longerwaitTime = 1000;
- void setup() {
-
-
- dot.begin( pin ).blink( dotTime, waitTime, 3 );
- dash.begin( pin ).blink( dashTime, waitTime, 3 );
-
-
- stepTimer.begin( 1700 ).repeat( ATM_COUNTER_OFF );
-
-
- step.begin()
- .onStep( 0, dot, Atm_led::EVT_BLINK )
- .onStep( 1, dash, Atm_led::EVT_BLINK )
- .onStep( 2, dot, Atm_led::EVT_BLINK );
-
-
- stepTimer.onTimer( step, Atm_step::EVT_STEP );
-
-
- stepTimer.start();
- }
- void loop() {
- automaton.run();
- }
|