Ejemplo n.º 1
0
void InitLED() {
    // P1.2 is led 0, P1.3 is led 1
    // P2.2 is led 2, P2.3 is led 3, P2.4 is led 4, P2.5 is led 5
    // P1.6 is led 6, P1.7 is led 7
    P2DIR |= (1 << 5) | (1 << 4) | (1 << 3) | (1 << 2);
    P1DIR |= (1 << 7) | (1 << 6) | (1 << 3) | (1 << 2);

    // Turn off the LEDs
    AllLEDOff();
}
Ejemplo n.º 2
0
void ShowStatus() {
    uint8_t i;
    if(LEDStatus == 0 || lastWhistleCount != whistleCount) {
        statusChange += 1;
        AllLEDOff();
        for (i = 0; i < whistleCount; i++) {
            LEDOn(i);
        }
    }
    LEDStatus = 1;
    lastWhistleCount = whistleCount;
}
Ejemplo n.º 3
0
void CancelStatus() {
    AllLEDOff();
    if(LEDStatus == 1)
        statusChange += 1;
    LEDStatus = 0;
}