-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathsos2.ino
38 lines (29 loc) · 881 Bytes
/
sos2.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#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() {
// Define two leds (patterns)
dot.begin( pin ).blink( dotTime, waitTime, 3 );
dash.begin( pin ).blink( dashTime, waitTime, 3 );
// Define a timer
stepTimer.begin( 1700 ).repeat( ATM_COUNTER_OFF );
// Define a step sequencer and link it to the leds we defined earlier
step.begin()
.onStep( 0, dot, Atm_led::EVT_BLINK )
.onStep( 1, dash, Atm_led::EVT_BLINK )
.onStep( 2, dot, Atm_led::EVT_BLINK );
// Set up the timer to drive the step sequencer
stepTimer.onTimer( step, Atm_step::EVT_STEP );
// Start the timer
stepTimer.start();
}
void loop() {
automaton.run();
}