avr/prototype/src/main.c

26 lines
475 B
C
Raw Normal View History

2022-04-17 04:43:50 +00:00
#include <avr/io.h>
#include <util/delay.h>
#include <base.h>
int main (void) {
DDRB = 0x18;
PORTB = 0x00;
_delay_ms(500);
io_pin_t enable_pin = { .port = &PORTB, .pin = 3 };
io_pin_t data_pin = { .port = &PORTB, .pin = 4 };
set_pin(&enable_pin);
for (uint8_t i = 0; i < 10; i++) {
set_pin(&data_pin);
_delay_ms(500);
clear_pin(&data_pin);
_delay_ms(500);
}
clear_pin(&enable_pin);
while(1) {};
}