Last active
September 20, 2022 18:28
-
-
Save ericevenchick/5331486 to your computer and use it in GitHub Desktop.
Blinking LED for Arduino in C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define F_CPU 16000000 | |
#include <avr/io.h> | |
#include <util/delay.h> | |
int main (void) | |
{ | |
// set all PORTB pins for output | |
DDRB = 0xFF; | |
for (;;) { | |
// toggle PORTB pins | |
PORTB ^= 0xFF; | |
// wait one second | |
_delay_ms(1000); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment