// code is not currently working correctly, do not use //
#pragma config(Sensor, in1, button, sensorAnalog)
#pragma config(Sensor, dgtl1, red, sensorLEDtoVCC)
#pragma config(Sensor, dgtl2, yellow, sensorLEDtoVCC)
#pragma config(Sensor, dgtl3, green, sensorLEDtoVCC)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main()
{
while (1 == 1)
{
while(SensorValue(button) == 0)
{
turnLEDOn(red);
turnLEDOn(yellow);
turnLEDOn(green);
wait(.5);
turnLEDOff(red);
turnLEDOff(yellow);
turnLEDOff(green);
wait(.5);
}
while(SensorValue(button) == 1)
{
turnLEDOff(red);
turnLEDOff(yellow);
turnLEDOff(green);
}
}
}
Comments
0 B
|👍
/👎