Toll-Free Customer Support 24/7

LED Blinking Code

void main() {
DDRA = 0xFF; // Set direction to be output
DDRB = 0xFF; // Set direction to be output
DDRC = 0xFF; // Set direction to be output
DDRD = 0xFF; // Set direction to be output

do {
PORTA = 0x00; // Turn OFF diodes on PORTA
PORTB = 0x00; // Turn OFF diodes on PORTB
PORTC = 0x00; // Turn OFF diodes on PORTC
PORTD = 0x00; // Turn OFF diodes on PORTD
Delay_ms(1000); // 1 second delay

PORTA = 0xFF; // Turn ON diodes on PORTA
PORTB = 0xFF; // Turn ON diodes on PORTB
PORTC = 0xFF; // Turn ON diodes on PORTC
PORTD = 0xFF; // Turn ON diodes on PORTD
Delay_ms(1000); // 1 second delay
} while(1); // Endless loop
}

Back to top