Nxt ultasonic sensor return -1


#1

Why sometimes the ultrasonic sensor returns -1 value ?


#2

Read lines 77-91 in BrickPi.py

It explains a fix.


#3

Hi @bonnaudet.eric,

This is usually observed when the Ultrasonic sensor returns junk values or when it goes unrecognised. This happens when the Ultrasonic Read is done continuously without a delay. This error can be minimized by adding delays.

-Shoban