diff options
author | joe <rbo@gmx.us> | 2025-09-24 22:22:14 +0200 |
---|---|---|
committer | joe <rbo@gmx.us> | 2025-09-24 22:22:14 +0200 |
commit | 9b77994475ff504d89a044e398e07ea043d88c52 (patch) | |
tree | 1110b920feaafa62799de8e0dde431b6f5352739 /src/esp | |
parent | ok (diff) | |
download | halfcab-9b77994475ff504d89a044e398e07ea043d88c52.tar.gz halfcab-9b77994475ff504d89a044e398e07ea043d88c52.tar.bz2 halfcab-9b77994475ff504d89a044e398e07ea043d88c52.tar.xz halfcab-9b77994475ff504d89a044e398e07ea043d88c52.tar.zst halfcab-9b77994475ff504d89a044e398e07ea043d88c52.zip |
good progress
Diffstat (limited to 'src/esp')
-rw-r--r-- | src/esp/halfcab/halfcab.ino | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/src/esp/halfcab/halfcab.ino b/src/esp/halfcab/halfcab.ino index f99393e..8d416c5 100644 --- a/src/esp/halfcab/halfcab.ino +++ b/src/esp/halfcab/halfcab.ino @@ -100,18 +100,9 @@ plain(void) CRGB color; color = BLACK; - while (Serial.available() <= 0) { - /* empty */ - } - color.r = Serial.read(); - while (Serial.available() <= 0) { - /* empty */ - } - color.g = Serial.read(); - while (Serial.available() <= 0) { - /* empty */ - } - color.b = Serial.read(); + color.r = read_byte(); + color.g = read_byte(); + color.b = read_byte(); fill(color); } @@ -149,19 +140,10 @@ loop(void) com = 0; com = read_byte(); if (com == 0xff) { - plain(); - return; - } else if (com == 0xfe) { dynamic(); + } else if (com == 0xfe) { + plain(); } else { fill(BLUE); } - - - - // else if (com == 0xfe) { - // dynamic(); - // } - - delay(10); } |