diff --git a/blink.c b/blink.c new file mode 100644 index 0000000..d01ecdc --- /dev/null +++ b/blink.c @@ -0,0 +1,11 @@ +#include +#include "drivers/led.h" + +int main(void) { + while(1) { + led(1); + _delay_ms(500); + led(0); + _delay_ms(500); + } +} diff --git a/drivers/led.c b/drivers/led.c new file mode 100644 index 0000000..0a01e9c --- /dev/null +++ b/drivers/led.c @@ -0,0 +1,10 @@ +#include "led.h" +#include + +void led(uint8_t on) { + if (on) { + LED_PORT |= (1 << LED_PIN); + } else { + LED_PORT &= ~(1 << LED_PIN); + } +} diff --git a/drivers/led.h b/drivers/led.h new file mode 100644 index 0000000..475ba23 --- /dev/null +++ b/drivers/led.h @@ -0,0 +1,3 @@ +#include + +void led(uint8_t on);