I am have a little issue with the below code.... I am attempting to read 3 different single byte return sensors on my new Create 2.... Now, it works perfectly if I read only one sensor in the repeatuntil loop. However if I do more than one read (like the code below).... the readings report back false... i.e. the bump sensor will indicate a bump when none occurred or the IR detect will indicate a bump instead of a indicating a close proximity of an object....
So am I daft and my code is wrong or does maybe the UART buffer need to be flushed after each read?
I am stumped....
uartWrite(0,1,142,45) # Read Roomba IR sensors single byte
uartWrite(0,1,142,7) #Roomba Bump and wheel drop sensor single byte
uartWrite(0,1,142,58) # Stasis (Rommba moving forward) single byte
print($x+" IR light object detected")
print($y+" bump detected")
print($z+" Is moving forward")