Last active
August 30, 2015 17:29
-
-
Save Aenohe/050f4caeda8ab3d37ee1 to your computer and use it in GitHub Desktop.
Revisions
-
Aenohe revised this gist
Aug 30, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # blink-led program written in C for AVR Microcontroller ``` #include <avr/io.h> -
Aenohe created this gist
Aug 30, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ # Test AVR Microcontroller with blink-led program written in C ``` #include <avr/io.h> #define F_CPU 16000000UL #include <util/delay.h> #define BLINK_DELAY_MS 1000 void setup() { DDRD = 0b00000100; PORTD = 0b00000000; } void loop() { PORTD = 0b00000100; _delay_ms(BLINK_DELAY_MS); PORTD = 0b00000000; _delay_ms(BLINK_DELAY_MS); } int main(void) { setup(); for (;;) { loop(); } } ```