0

Soccer Robot C - Basic lessons - Exercises - How to be sure?

Sensors are not perfect. Reflectance sensor is fairy exact, but distance sensors may be fooled, for example by light reflected from the surface. How to alleviate this problem?

Task: make sensor's reading You can rely on.

Starting with a program that stops in the front of an obstacle, improve it, so that it (almost) never stops by mistake when there is no obstacle. Here is the program You have to improve:

void RobotSoccer::loop() {
	if (setup())
		go(50, 0);

	if (front() < 60)
		end();
}