I connected US Sensor and tried to get the value from US Sensor.
It works well if something is in the range of sensor.
But if there's nothing in the range of sensor, after then, it sucks to return the value even though something is in the range of the sensor.
I got the values which makes no sense : 315, 375, 789, and so on...
Here's my code(in NXC),
task measure_dist() {
int sv;
SetSensorUltrasonic(S4);
ClearSensor(S4);
while(true) {
TextOut(20,LCD_LINE7,"Reading:");
sv=SensorUS(S4);
NumOut(70,LCD_LINE7,sv);
wait(250);
}
}
I really need your help... How can i fix it?
