-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebug.h
42 lines (32 loc) · 782 Bytes
/
debug.h
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
void debug_print_with_leading_zeros(uint8_t number) {
if (number < 100) {
Serial.print("0");
}
if (number < 10) {
Serial.print("0");
}
Serial.print(number);
}
void debug_println(String line) {
Serial.print("S-");
debug_print_with_leading_zeros(state);
Serial.print("/");
debug_print_with_leading_zeros(state_step);
Serial.print(" P-");
debug_print_with_leading_zeros(state_position);
Serial.print(" ");
for (uint8_t i = 0; i < BUZZERS; i++) {
Serial.print(buzzer_active[i] ? "1" : "0");
}
Serial.print(" | ");
Serial.println(line);
}
// MAIN ---------------------------------------------------------------------------------
void setup_debug() {
Serial.begin(9600);
while(!Serial) {
delay(10);
}
}
void loop_debug() {
}