Add additional check for serial data.

This commit is contained in:
Josh Stewart 2013-09-24 23:29:35 +10:00
parent 4390be7494
commit 7c1d02209d
1 changed files with 1 additions and 1 deletions

View File

@ -62,6 +62,7 @@ void command()
//digitalWrite(13, LOW);
byte offset;
while (Serial.available() == 0) { }
offset = Serial.read();
while (Serial.available() == 0) { }
@ -120,7 +121,6 @@ void receiveValue(byte offset, byte newValue)
if (offset < 64) //New value is part of the fuel map
{
fuelTable.values[7-offset/8][offset%8] = newValue;
if(offset==20) {newValue = 111;}
return;
}
else if (offset < 80) //New value is one of the X or Y axis bins