diff options
author | Daniel Friesel <derf@finalrewind.org> | 2016-01-12 12:29:35 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2016-01-12 12:29:35 +0100 |
commit | f078fe9b54424b6ba12a64d981607c0ead887078 (patch) | |
tree | 43ada0be1cec612c0d9549718c86bddf3de68840 /main.c | |
parent | 2bde0a2dc668f0a95f0060f6cf9181c69a0182d1 (diff) |
add Makefile and main.c stub (with display test code)
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -0,0 +1,31 @@ +#include <avr/io.h> +#include <avr/wdt.h> +#include <util/delay.h> +#include <stdlib.h> + +int main (void) +{ + unsigned int i, j, h; + wdt_disable(); + + DDRB = 0xff; + DDRD = 0xff; + + PORTB = 0; + PORTD = 0; + + while (1) { + for (i = 1; i < 256; i *= 2) { + PORTB = i; + for (j = 1; j < 256; j *= 2) { + PORTD = ~j; + for (h = 1; h < 1; h++) { // use "h < 4096" for visible pixels (e.g. finding soldering errors) + asm("nop"); + } + } + PORTB = 0; + } + } + + return 0; +} |