File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
1
#include < RCSwitch.h>
2
2
#include < SPI.h>
3
3
#include < SD.h>
4
+ #include < AsyncTimer.h>
4
5
6
+ AsyncTimer t;
5
7
File myFile;
6
8
RCSwitch mySwitch = RCSwitch();
7
9
volatile unsigned long priv_decimal = 0 ;
8
10
String incomingString;
11
+ bool led_state = false ;
9
12
10
13
void setup () {
11
14
// put your setup code here, to run once:
@@ -25,13 +28,21 @@ void setup() {
25
28
mySwitch.enableTransmit (D1);
26
29
27
30
pinMode (LED_BUILTIN, OUTPUT);
28
- digitalWrite (LED_BUILTIN, LOW);
31
+ t.setInterval (
32
+ [](){
33
+ digitalWrite (LED_BUILTIN, led_state);
34
+ led_state = !led_state;
35
+ },
36
+ 1000
37
+ );
29
38
30
39
Serial.println (" ready" );
31
40
}
32
41
33
42
void loop () {
34
43
// put your main code here, to run repeatedly:
44
+ t.handle ();
45
+
35
46
if (mySwitch.available ()) {
36
47
unsigned int protocol = mySwitch.getReceivedProtocol ();
37
48
unsigned long decimal = mySwitch.getReceivedValue ();
You can’t perform that action at this time.
0 commit comments