avr/display-i2c/main.c

28 lines
664 B
C
Raw Normal View History

2022-07-14 23:11:23 +00:00
#include <display.h>
#include <stdio.h>
int main(void) {
display_t display = {
.reg = {
.output = { .ddr = &DDRB, .port = &PORTB, .pin = &PINB, .addr = 3 },
.shift_clock = { .ddr = &DDRB, .port = &PORTB, .pin = &PINB, .addr = 2 },
.latch_clock = { .ddr = &DDRB, .port = &PORTB, .pin = &PINB, .addr = 0 },
},
};
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;
}