mirror of
https://github.com/skogaby/OpeNITHM.git
synced 2026-09-22 22:58:16 +03:00
Fix unnecessary character requirement in serial commands
This commit is contained in:
committed by
Jonathan Montineri
parent
ab765cc233
commit
2e2c3093c5
@@ -40,11 +40,12 @@ void onKeyPress(int key, bool wasHeld)
|
||||
void parseCommand()
|
||||
{
|
||||
char input1 = Serial.read();
|
||||
while(!Serial.available());
|
||||
char input2 = Serial.read();
|
||||
char input2;
|
||||
switch (input1)
|
||||
{
|
||||
case 't': // touchboard
|
||||
while(!Serial.available());
|
||||
input2 = Serial.read();
|
||||
while(!Serial.available());
|
||||
switch (input2)
|
||||
{
|
||||
@@ -62,6 +63,8 @@ void parseCommand()
|
||||
}
|
||||
break;
|
||||
case 'i': // ir sensors
|
||||
while(!Serial.available());
|
||||
input2 = Serial.read();
|
||||
while(!Serial.available());
|
||||
switch (input2)
|
||||
{
|
||||
@@ -111,6 +114,8 @@ void parseCommand()
|
||||
Serial.print(";");
|
||||
break;
|
||||
case 'l': // change led color
|
||||
while(!Serial.available());
|
||||
input2 = Serial.read();
|
||||
while(!Serial.available());
|
||||
switch (input2)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user