[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
NqcSetSensor
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
NqcSetSensor
(NQC) SetSensor
Function.//Syntax SetSensor( [SensorIndex] , [SensorType] );
Example
task main()
{
//Define the first sensor to be a touch sensor
SetSensor(SENSOR_1,SENSOR_TOUCH);
//Make motor A go forward at full speed
OnFwd(OUT_A);
//Do nothing, until sensor 1 is touched
until (SENSOR_1 == 1)
{
//Noting
}
//Turn off motor A
Off(OUT_A);
}
Code links
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
