Skip to content

Commit 53cf7b2

Browse files
committed
serial test added
1 parent afdb2d4 commit 53cf7b2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Serial_Test/Serial_Test.ino

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
int count = 0;
2+
unsigned long previousMillis = 0;
3+
const long interval = 1000;
4+
5+
void setup() {
6+
Serial.begin(115200);
7+
}
8+
void loop() {
9+
unsigned long currentMillis = millis();
10+
11+
if(Serial.available()>0){
12+
Serial.println("Back: "+Serial.readString());
13+
}
14+
15+
if (currentMillis - previousMillis >= interval) {
16+
previousMillis = currentMillis;
17+
Serial.println("Ping: "+String(count));
18+
count++;
19+
}
20+
}

0 commit comments

Comments
 (0)