Improve the serial test by comparing a character type

This commit is contained in:
mmcwilliams 2018-01-09 23:24:09 -05:00
parent a251a1492c
commit f671967c18
1 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,7 @@
volatile char cmd_char = 'z';
const char cmd_id = 'i';
void setup() {
Serial.begin(57600);
Serial.flush();
@ -17,7 +19,7 @@ void loop() {
}
void cmd (char val) {
if (val == 'i') {
Serial.println("i");//End of action
if (val == cmd_id) {
Serial.println(cmd_id);//End of action
}
}