HTML icon

blink_button-i.c

HTML | PRO | 10/30/17 12:53:32 PM UTC | 0 ⭐ | 361 👁️ | Never ⏰ | []
C |

740 B

|

None

|

0 👍

/

0 👎

// 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

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎