NXC  Version 1.2.1 r5
 All Data Structures Files Functions Variables Groups Pages
ex_NXTSumoEyes.nxc

This is an example of how to use the SetSensorNXTSumoEyes, SensorNXTSumoEyes, SensorNXTSumoEyesRaw, NumOut, and Wait functions.

inline void TurnLeft() { }
inline void TurnRight() { }
inline void GoStraight() { }
inline void SearchForObstacle() { }
task main()
{
SetSensorNXTSumoEyes(S1, true); // long range
while(true)
{
char zone = SensorNXTSumoEyes(S1);
switch (zone) {
TurnLeft();
break;
TurnRight();
break;
GoStraight();
break;
default:
SearchForObstacle();
break;
}
}
}