heptagon-arduino/led.c
2020-12-14 20:22:04 +01:00

20 lines
No EOL
351 B
C

#include <avr/io.h>
#include <util/delay.h>
#define BLINK_DELAY_MS 4000
int main (void)
{
/* set pin 5 of PORTB for output*/
DDRB |= _BV(DDB4);
while(1) {
/* set pin 5 high to turn led on */
PORTB |= _BV(PORTB4);
_delay_ms(BLINK_DELAY_MS);
/* set pin 5 low to turn led off */
PORTB &= ~_BV(PORTB4);
_delay_ms(BLINK_DELAY_MS);
}
}