CODE-at-TACC / summer-2015

Materials for the Summer 2015 CODE@TACC workshop
3 stars 6 forks source link

Ultrasonic Sensor default value #5

Open joonyeechuah opened 9 years ago

joonyeechuah commented 9 years ago

What's the expected behavior of the Ultrasonic Sensor when no signal is returned? (i.e., angle of attack is 45 degrees or more) The original lego sensor spec says the device returns -1 when it doesn't get a signal in continuous mode. (There's also a burst mode that I don't think is supported by BrickPi.)

mwvaughn commented 9 years ago

The BrickPi library abstracts this behavior and returns maximum distance (255). Basically, I think you can count on 0-255 coming from the sensor at any given time.