From f671967c187a77c3ca1dde66b715195215c5fd77 Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Tue, 9 Jan 2018 23:24:09 -0500 Subject: [PATCH] Improve the serial test by comparing a character type --- ino/components/mcopy_serial_tests/mcopy_serial_tests.ino | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ino/components/mcopy_serial_tests/mcopy_serial_tests.ino b/ino/components/mcopy_serial_tests/mcopy_serial_tests.ino index 5016cf1..c15c067 100644 --- a/ino/components/mcopy_serial_tests/mcopy_serial_tests.ino +++ b/ino/components/mcopy_serial_tests/mcopy_serial_tests.ino @@ -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 } }