Last active
August 29, 2015 14:27
-
-
Save Technicus/be8edc7430440139224f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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