Infrared vs Ultrasonic Sensors
As I’m putting the carbot on the road I’m going over old ground from when I did the arduino version. One of the things I note is that I eventually switched from the ultrasonic sensor to an infrared one at least for the front-facing one. I think I did that because it was faster to read and I didn’t have the two sensors interfering with each other. When I used two ultrasonics I had to fire them alternately so they couldn’t “hear” each other and you can only fire them every 50-60ms so it could easily be >100ms between front pings and the car was travelling at 100 inches/sec so it could go quite a ways between pings. The Infrared sensor gives a pretty much continuous reading but the output is an analog voltage from 0-5V. I don’t have a way of reading that at the moment so I’ll try to work with the two ultrasonics for now.
There’s some notes about the issues with ultrasonics on the arduino forums.