hello.c
changeset 47 7f930a94ee1e
child 49 f01fb659e54d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hello.c	Wed Apr 02 19:10:05 2014 +0300
@@ -0,0 +1,22 @@
+#include <avr/io.h>
+#include <util/delay.h>
+
+#define false       0
+#define true        1
+
+#define SBI(port, bit) do { port |= (1 << (bit)); } while (0)
+#define CBI(port, bit) do { port &= ~(1 << (bit)); } while (0)
+
+int main (void)
+{
+    // LED
+    SBI(DDRB, DDB5);
+
+    while (true) {
+        // flip
+        PORTB ^= (1 << PORTB5);
+        
+        // busyloop
+        _delay_ms(1000);
+    }
+}