2011-03-14 20:16:49 +01:00
|
|
|
/*
|
|
|
|
* Hello world of AVR. Blink led PORTB5 (Arduino digital 13).
|
|
|
|
*
|
|
|
|
* To compile and upload run: make clean; make; make program;
|
|
|
|
*
|
|
|
|
* Copyright 2009-2011 Mika Tuupola
|
|
|
|
*
|
|
|
|
* Licensed under the MIT license:
|
|
|
|
* http://www.opensource.org/licenses/mit-license.php
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2009-12-24 17:27:04 +01:00
|
|
|
#include <avr/io.h>
|
|
|
|
#include <util/delay.h>
|
|
|
|
|
2011-03-14 20:16:49 +01:00
|
|
|
int main(void)
|
2009-12-24 17:27:04 +01:00
|
|
|
{
|
|
|
|
/* Make PORTB5 (Arduino pin 13) an output. */
|
|
|
|
DDRB |= _BV(PORTB5);
|
|
|
|
|
|
|
|
for(;;){
|
|
|
|
/* Toggle state of PORTB5 (Arduino pin 13). */
|
|
|
|
PORTB ^= _BV(PORTB5);
|
|
|
|
_delay_ms(500);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Never reached. */
|
|
|
|
return 0;
|
|
|
|
}
|