#define DIRK (*((volatile uint8_t*)0x107))
#define DIRF (*((volatile uint8_t*)0x30))
#define OUTF (*((volatile uint8_t*)0x31))
#define OUTK (*((volatile uint8_t*)0x108))
void delay1(volatile long y){
y *= 1000000;
while(y--);
}
int main() {
DIRK |= 0xFF;
DIRF |= 0xFF;
uint8_t outF_values[] = {0xA3, 0x8C, 0x84, 0xAB};
uint8_t outK_values[] = {0x01, 0x02, 0x04, 0x08};
while (1) {
for (int i = 0; i < 4; i++) {
// Set output
OUTF = outF_values[i];
OUTK = outK_values[i];
// Return segments to 0V
OUTF = 0xFF;
OUTK = 0x00;
}
//for (volatile long y = 0; y < 200000; y++);
delay1(0);
}
return 0;
}