blob: cd01798720f58a0c53394df2612f0c753d6d9ba9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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);
}
}
|