A simple LED blink using Pure C in Arduino

Worked with ATmega8 using Eclipse.

Command used: avrdude    -pm8 -carduino -P/dev/ttyUSB0 -b19200 -v
            -Uflash:w:TestBlink1.hex:a

/*
* main.c
*
*      Author: praveenmax
*/

#include <avr/io.h>
#include <util/delay.h>

#define BLINK_DELAY_MS 100

int main(void)
{

DDRB |=_BV(DDB5);

while(1)
{

 PORTB |= _BV(PORTB5);
_delay_ms(BLINK_DELAY_MS);

 PORTB &= ~ _BV(PORTB5);
_delay_ms(BLINK_DELAY_MS);
}

}

About PraveenMax
My Interests: ------------------ Programming , Drawing & Music

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: