diff --git a/firmware/main.c b/firmware/main.c index b993110..245bbca 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -83,7 +83,6 @@ ISR (TIMER1_COMPA_vect) // PORTD = __, 9, C, B, A,D+,D-,__ PORTD &= 0b10000111; // delete bit 3 to 6 (bit 3 to 5 = layer 0 to 2; bit 6 = wire 9 to the LEDs) - PORTD |= (1 << 6) | ((1 << level) << 3); // set the current level and pin 6 to high (9th LEDs off) uint8_t tmp = level * 9; // calculate the position in the frame @@ -94,6 +93,8 @@ ISR (TIMER1_COMPA_vect) if ( (((frame >> tmp) >> 8) & 0x01) ) PORTD &= ~(1 << 6); // turn the 9th LED on if required + PORTD |= (1 << 6) | ((1 << level) << 3); // set the current level and pin 6 to high (9th LEDs off) + // rotate through the 3 level level++; if (level > 2) level = 0;