avr/display-i2c/main.c

29 lines
681 B
C

#include <display.h>
#include <stdio.h>
#include <i2c.h>
int main(void) {
display_t display = {
.reg = {
.output = { .ddr = &DDRF, .port = &PORTF, .pin = &PINF, .addr = 7 },
.shift_clock = { .ddr = &DDRF, .port = &PORTF, .pin = &PINF, .addr = 6 },
.latch_clock = { .ddr = &DDRF, .port = &PORTF, .pin = &PINF, .addr = 5 },
},
};
int count = 0;
while (1) {
display_init(&display);
char msg[15];
snprintf(msg, 15, "[%d]", count);
display_clear(&display);
display_write_message(&display, msg);
_delay_ms(1000);
count++;
}
return 0;
}