#include <avr/io.h>
#define F_CPU 16000000UL
#include <util/delay.h>
#define BLINK_DELAY_MS 1000
void setup() {
DDRD = 0b00000100;
PORTD = 0b00000000;
}
void loop() {
PORTD = 0b00000100;
_delay_ms(BLINK_DELAY_MS);
PORTD = 0b00000000;
_delay_ms(BLINK_DELAY_MS);
}
int main(void) {
setup();
for (;;) {
loop();
}
}
Last active
August 30, 2015 17:29
-
-
Save Aenohe/050f4caeda8ab3d37ee1 to your computer and use it in GitHub Desktop.
blink-led program written in C for AVR Microcontroller
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment