Android app updated (now the Android app acts even as client using the
device's accelerometers).
This commit is contained in:
@@ -64,11 +64,13 @@ void loop(){
|
||||
}
|
||||
|
||||
boolean readGamepadPositionFromSerial(){
|
||||
if(Serial.available()>1){ //Bytes received in pairs
|
||||
if(Serial.available()==2){ //Bytes received in pairs
|
||||
gamepadPosition[0] = Serial.read();
|
||||
gamepadPosition[1] = Serial.read();
|
||||
return true;
|
||||
}
|
||||
} else { //Data corruption: even bits!
|
||||
Serial.readBytes(NULL, Serial.available());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user