diff options
Diffstat (limited to 'tamper/src/led-test/main.c')
-rw-r--r-- | tamper/src/led-test/main.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tamper/src/led-test/main.c b/tamper/src/led-test/main.c new file mode 100644 index 0000000..cd01798 --- /dev/null +++ b/tamper/src/led-test/main.c @@ -0,0 +1,29 @@ +#include <inttypes.h> +#include <avr/io.h> +//#include <util/delay.h> + +#include "iotn828.h" + +#define AVR_LED4 PORTA4 /* RED */ +#define AVR_LED3 5 /* YELLOW */ +#define AVR_LED2 6 /* GREEN */ +#define AVR_LED1 7 /* BLUE */ + + +void main() { + int i; + uint8_t j = 0; + + /* Enable PA4 output */ + // DDRA |= (1 << AVR_LED4) | (1 << AVR_LED3) | (1 << AVR_LED2) | (1 << AVR_LED1); + DDRA |= 0xf0; + + //PORTA = 0; + while (1) { + PORTA = (PORTA & 0x0f) | ((j++<<4) & 0xf0); + //PORTA ^= (1 << AVR_LED1); + //PORTA = j++; + for (i = 0; i < 10000; i++) { ; } + //_delay_ms (100); + } +} |