Commit 802c3c09 authored by Thomas Maaß's avatar Thomas Maaß
Browse files

Added defines for switch interval and duration

parent 30632503
#include <avr/io.h>
#include <util/delay.h>
#define INTERVAL 10000 // switch interval in ms
#define DURATION 3000 // switch duration in ms
int main(void) {
DDRB = 0x01;
PORTB = 0x3e;
while(1) {
PORTB |= (1 << PB0);
_delay_ms(3000);
_delay_ms(DURATION);
PORTB &= ~(1 << PB0);
_delay_ms(10000);
_delay_ms(INTERVAL);
}
return 0;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment