Fixed logic errors in arduino

This commit is contained in:
Jake Hillion 2020-04-26 20:11:52 +01:00
parent 25bbed17c0
commit 87cda5de60

View File

@ -28,24 +28,6 @@ void loop() {
if (Serial.available() > 0) { if (Serial.available() > 0) {
int data; int data;
switch (data = Serial.read()) { switch (data = Serial.read()) {
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
hex = (hex << 2) + charMap(data);
break;
case 'n': case 'n':
nextColour(); nextColour();
break; break;
@ -58,6 +40,9 @@ void loop() {
case 'r': case 'r':
resetState(); resetState();
break; break;
default:
hex = (hex << 1) + charMap(data);
break;
} }
} }
} }
@ -77,6 +62,7 @@ void nextLed() {
leds[strip][i] = color; leds[strip][i] = color;
} }
led++
rgb = hex = 0; rgb = hex = 0;
} }