summaryrefslogtreecommitdiffstats
path: root/avr-blinkled-atmega328p/main.c
diff options
context:
space:
mode:
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;
+}