Last active
October 16, 2017 13:27
-
-
Save tokolist/5387210 to your computer and use it in GitHub Desktop.
AVR Microcontroller Hello World (LED Blink) http://youtu.be/smsW95zcFfE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define F_CPU 1000000 //1MHz | |
#include <avr/io.h> | |
#include <util/delay.h> | |
int main(void) | |
{ | |
DDRC |= (1<<DDC5); // set LED pin PC5 to output | |
while(1) | |
{ | |
PORTC |= (1<<PORTC5); // drive PC5 high | |
_delay_ms(500); // delay 500 ms | |
PORTC &= ~(1<<PORTC5); // drive PC5 low | |
_delay_ms(500); // delay 500 ms | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment