I plan to use an ATTiny13 for a traffic light with pedestrian crossing lights and a railroad crossing. PB0 as an interrupt for sensor to activate crossing lights. So 12 leds (6 for traffic lights, 4 for pedestrian crossing, 2 for railroad crossing). Charlieplexing gives me 12 LEDs for pins 1, 2, 3, 4.
I first wanted to illuminate each LED to make sure I had all configured correctly, but came to an issue when I tested the first three LEDs. After I had this figured out I would put together loops to sequence the lights and flicker as needed.
The first three LEDs share a common High, PB1. Low is PB2, PB3, PB4. Each pin has a resistor, same LEDs.
Unfortunately I have not gotten past the first three LEDs.
I expected them to illuminate one at a time, one second apart. What I get is Nred bright, Ngreen dim, Ngreen bright.
#define DELAYflashing 1000
/* Test sequence
light each led one at a time to verify its address and functionality
DDRB = 0b00000110; PORTB |= (1<<PB1); PORTB &= ~(1<<PB2); // Nred
DDRB = 0b00001010; PORTB |= (1<<PB1); PORTB &= ~(1<<PB3); // Ngreen
DDRB = 0b00010010; PORTB |= (1<<PB1); PORTB &= ~(1<<PB4); // Nyellow