You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
351 B
C

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