aboutsummaryrefslogtreecommitdiffstats
path: root/avr-blinkled-atmega328p/main.c
diff options
context:
space:
mode:
authorVG <vg@devys.org>2015-08-26 18:45:01 +0200
committerVG <vg@devys.org>2015-08-26 18:45:01 +0200
commit7346cfaad4d969db060f3c7ae242ea93f4fff5c0 (patch)
tree3d3a09a29f783270b8da931e3c879234553ec43f /avr-blinkled-atmega328p/main.c
downloadavr-7346cfaad4d969db060f3c7ae242ea93f4fff5c0.tar.gz
avr-7346cfaad4d969db060f3c7ae242ea93f4fff5c0.tar.bz2
avr-7346cfaad4d969db060f3c7ae242ea93f4fff5c0.zip
Diffstat (limited to 'avr-blinkled-atmega328p/main.c')
-rw-r--r--avr-blinkled-atmega328p/main.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/avr-blinkled-atmega328p/main.c b/avr-blinkled-atmega328p/main.c
new file mode 100644
index 0000000..8d9e288
--- /dev/null
+++ b/avr-blinkled-atmega328p/main.c
@@ -0,0 +1,17 @@
+#include <avr/io.h>
+#include <util/delay.h>
+
+int main(void)
+{
+ /* PB4 output */
+ DDRD |= _BV(PB4);
+ PORTB &= ~_BV(PB4);
+
+ for (;;)
+ {
+ _delay_ms(1000);
+ PORTB ^= _BV(PB4);
+ }
+
+ return 0;
+}