Hi, complete noob here. I’m making a robot for class and I want to use an ultrasonic range finder, but the teacher only has the Arduino HC-SR04 (rather than the VEX rangefinder). Would it be possible to use this piece along with the other VEX hardware, (and if so, how?)
I’m going to add a note from past experience with an Arduino rangefinder. (I think the same one, but I don’t have access to it now to check.) Periodically it would spit out really, really high values. This was true even when stationary and looking at a huge, flat, stationary surface. It seemed to err more often than the typical error rate I’ve heard discussed with rangefinders. So if you’re searching for above a certain value or, as my student was, for a sudden change it can be problematic. The solution I gave to him was a simple filter. Just check against more than one recent value, like the last two or three. Basically, if you take the smaller of two or the median (not mean!!!) of three, a single large value becomes irrelevant.
I am now experiencing issues with the values the rangefinder returns. I put Echo and Trig on the left in ports 8 and 9, VCC in the center for 8, and Ground on the right. Using the Forward until Close Proximity sample program I have found that the sensor does not seem to be returning values, only -1. Is there any trouble shooting method I can use to find returned values?