-
Notifications
You must be signed in to change notification settings - Fork 2
/
state.ino
49 lines (31 loc) · 793 Bytes
/
state.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
39
40
41
42
43
44
45
46
47
48
49
#include "state.h"
unsigned long lastMillis = millis();
unsigned long prevTimeOut = millis();
int timeOut = 3000;
void serialLoop()
{
if (unsigned long currentTime = millis() > prevTimeOut +timeOut)
{
//////////// try to Read
while (Serial.available())
{
Serial.println("Serial Available : ");
Serial.println();
char x = (char)Serial.read();
Serial.println(x);
//getDataFromPC(x);
}
prevTimeOut = millis();
Serial.println("Time Out");
}
else
{
}
/////////////time out
}
void setup()
{
}
void loop() {
blink();
}