Created
October 10, 2017 08:31
-
-
Save luisfmcalado/8ab79da7f1a15276220cb80fe634eafc to your computer and use it in GitHub Desktop.
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
#ifndef F_CPU | |
#define F_CPU 16000000UL // cpu frequency | |
#endif | |
#include <avr/io.h> | |
#include <util/delay.h> | |
#ifndef DELAY_MS | |
#define DELAY_MS 2000 | |
#endif | |
int main(void) | |
{ | |
DDRB |= (1<<DDB5); // set led (pin 13 / PB5) on PORTB to output | |
while(1) | |
{ | |
PORTB |= (1<<PORTB5); // set pin 13 / PB5 on | |
_delay_ms(DELAY_MS); // delay ms amount | |
PORTB &= ~(1<<PORTB5); // set pin 13 / PB5 off | |
_delay_ms(DELAY_MS); // delay ms amount | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment