Created
August 18, 2015 19:31
-
-
Save Technicus/191c33d428f7a08ef18c 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
| int checkSensors(byte whichSensor, byte howManyBytes){ | |
| int timeOut = 40; | |
| roombaSerial.write(149); | |
| roombaSerial.write((byte)howManyBytes); | |
| for (int x = 0; x < howManyBytes ; x++) { | |
| roombaSerial.write((byte)whichSensor++); | |
| } | |
| int bufferPos = 0; | |
| while(howManyBytes) { | |
| while (roombaSerial.available() == 0) { | |
| delayMicroseconds(1); | |
| } | |
| response[bufferPos++] = roombaSerial.read(); | |
| howManyBytes -= 1; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment