Skip to content

Instantly share code, notes, and snippets.

@Technicus
Last active August 29, 2015 14:27
Show Gist options
  • Save Technicus/be8edc7430440139224f to your computer and use it in GitHub Desktop.
Save Technicus/be8edc7430440139224f to your computer and use it in GitHub Desktop.
void brushMotorCurrentTest_00(){
byte response[16];
int incomingByte = 0; // for incoming serial data
int timeOut = 40;
int bufferPos = 0;
byte howManyBytes = 2;
cleaningMotors(primary, 30); // spin the primary motor
roombaSerial.write(142); // ask for sensor data
roombaSerial.write((int8_t)56); // ask for primary motor current, return 2 signed data bytes high byte first, -32768 to 32767 mA
delayMicroseconds(1);
if (roombaSerial.available() > 0) {
// read the incoming byte:
incomingByte = roombaSerial.read();
}
Serial.print("Brush Motor Current: \t");
Serial.print(incomingByte);
Serial.print("\tcheck\n");
delay(2000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment