#include <avr/io.h>
#include <util/delay.h>
intmain(void){// The LED is on Port B, Pin 5
// Setup LED pin as an output
DDRB|=_BV(5);// Loop forever
while(1){// Turn LED on for 500ms
PORTB|=_BV(5);_delay_ms(500);// Turn LED off for 500ms
PORTB&=_BV(5)^0xFF;_delay_ms(500);}}
From the main menu, choose Project -> Build Project.
Eclipse will build your project and when it is done you should see output similar to this
in the CDT Build Console view:
1
2
3
4
5
6
7
8
9
10
12:12:01 **** Rebuild of configuration Debug for project Blink ****
Info: Internal Builder is used for build
avr-gcc -DF_CPU=16000000UL -Os -g3 -Wall -c -fmessage-length=0 -ffunction-sections -fdata-sections -mmcu=atmega328p -o main.o ../main.c
avr-gcc -mmcu=atmega328p -Xlinker -Map=Blink.map -Xlinker --gc-sections -o Blink main.o
avr-size Blink
text data bss dec hex filename
176 0 0 176 b0 Blink
avr-objcopy -O ihex -R .eeprom Blink Blink.hex
12:12:02 Build Finished (took 355ms)
Before moving on, make sure that there are no errors generated during the build.
If you do encounter errors, make sure that the source code is correct, make any necessary changes, and build again.