-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathsos3.ino
More file actions
38 lines (30 loc) · 859 Bytes
/
sos3.ino
File metadata and controls
38 lines (30 loc) · 859 Bytes
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 led[3];
Atm_timer timer[3];
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() {
led[0].begin( pin )
.blink( dotTime, waitTime, 3 )
.onFinish( timer[0], Atm_timer::EVT_START );
timer[0].begin( longwaitTime )
.onTimer( led[1], Atm_led::EVT_BLINK );
led[1].begin( pin )
.blink( dashTime, waitTime, 3 )
.onFinish( timer[1], Atm_timer::EVT_START );
timer[1].begin( longwaitTime )
.onTimer( led[2], Atm_led::EVT_BLINK );
led[2].begin( pin )
.blink( dotTime, waitTime, 3 )
.onFinish( timer[2], Atm_timer::EVT_START );
timer[2].begin( longerwaitTime )
.onTimer( led[0], Atm_led::EVT_BLINK );
led[0].start();
}
void loop() {
automaton.run();
}