2022-07-30 04:33:46 +00:00
|
|
|
#include <dio.h>
|
2022-07-20 23:19:45 +00:00
|
|
|
|
|
|
|
#define TIMEOUT 1
|
|
|
|
|
|
|
|
int main(void) {
|
|
|
|
dio_t power = { .ddr = &DDRB, .pin = &PINB, .port = &PORTB, .addr = 3 };
|
|
|
|
dio_set_direction(&power, LINE_OUT);
|
|
|
|
|
|
|
|
int timeout_seconds = TIMEOUT;
|
|
|
|
while (1) {
|
|
|
|
if (timeout_seconds <= 0) {
|
|
|
|
dio_set(&power, 1);
|
|
|
|
_delay_ms(50);
|
|
|
|
dio_set(&power, 0);
|
|
|
|
timeout_seconds = TIMEOUT;
|
|
|
|
}
|
|
|
|
timeout_seconds--;
|
|
|
|
_delay_ms(1000);
|
|
|
|
}
|
|
|
|
}
|