forked from sakuraio/SakuraIOArduino
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlphaCompat.ino
More file actions
39 lines (31 loc) · 874 Bytes
/
AlphaCompat.ino
File metadata and controls
39 lines (31 loc) · 874 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
39
#include <SakuraIOAlphaCompat.h>
/*
* WARNING : SakuraIOAlphaCompat is deprecated. DO NOT USE in new development work.
*/
//SakuraIOAlphaCompatSPI sakuraio(10);
SakuraIOAlphaCompatI2C sakuraio;
uint32_t cnt = 0;
void setup() {
Serial.begin(9600); // start serial for output
Serial.println("[WARNING] SakuraIOAlphaCompat is deprecated. DO NOT USE in new development work.");
Serial.println("Waiting to come online");
for(;;){
if( sakuraio.getNetworkStatus() == 1 ) break;
delay(1000);
Serial.print(".");
}
Serial.println("");
}
void loop() {
cnt++;
Serial.println(cnt);
sakuraio.writeChannel(0,cnt);
sakuraio.writeChannel(1,cnt);
sakuraio.writeChannel(2,cnt);
delay(250);
Serial.print("Tx status: ");
Serial.print( sakuraio.getTxChannelStatus(0) );
Serial.println("");
sakuraio.transmit(TRANSMIT_ONCE);
delay(5000);
}