Skip to content

Commit 1544150

Browse files
Update prototype.pde
Serial configuration at compiler moment.
1 parent 7be1bb3 commit 1544150

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

prototype.pde

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
2+
#ifndef SERIAL_RATE
3+
#define SERIAL_RATE 115200
4+
#endif
5+
6+
#ifndef SERIAL_TIMEOUT
7+
#define SERIAL_TIMEOUT 5
8+
#endif
9+
110
void setup() {
2-
Serial.begin(115200);
3-
Serial.setTimeout(5);
11+
Serial.begin(SERIAL_RATE);
12+
Serial.setTimeout(SERIAL_TIMEOUT);
413

514
int cmd = readData();
615
for (int i = 0; i < cmd; i++) {
@@ -35,4 +44,4 @@ char readData() {
3544
return Serial.parseInt();
3645
}
3746
}
38-
}
47+
}

0 commit comments

Comments
 (0)