I’m trying to gain a better understanding of how the ultrasound sensor works, especially with RobotC.
Elsewhere on the forum, I have seen statements that suggest that the ultrasound sensor only “pings” when RobotC encounters a statement such as
** if (SensorValue[ultrasonic] > 0)**.
But I’ve been wondering what really goes on between the code, the Cortex, and the ultrasound sensor. For example, does the ultrasound merely “ping” once, emitting merely a single pulse of sound, and from that single solitary pulse determine distance? Or does it emit, say, 10 pulses in a row and then take some sort of average before reporting back to RobotC with an answer to SensorValue[ultrasonic]?
Or does the ultrasound continuously “ping” on its own, and only when RobotC requests some data does SensorValue[ultrasonic] get set to the most updated value?
I have a number of reasons for asking. First, I’ve been wondering if the ultrasound might give better data if multiple readings are averaged out in RobotC. Second, I’m trying to determine the probability than numerous ultrasounds used on a single robot (or multiple robots on the field) might interfere with each other and give false readings.
I have seen postings on the forum that suggest ultrasound sensors might be enabled and read one at a time, so if multiple sensors are used on a single robot, then interference is not a problem. But what if there are other robots on the field whose sensors are pinging continuously? Are the timing intervals so tight that acoustic interference is not a problem?