Let's go through the following C program first.
Explanation of blinkLED.c file:
Summary of blinkLED.c file:
First we have included
<avr/io.h> is a header file that includes AVR device-specific IO definitions. In our program it defines all the DDRs and PORTs.
<util/delay.h> defines the _delay_ms() function which we use to delay between two blinks.
_delay_ms(500): in this case the delay between ON/OFF states is 500 ms.
Output of this program:
I have connected PB0 to the first LED (from right side). So that Red LED is blinking continuously (500 ms delay between two blinks).