Created
June 10, 2012 22:13
-
-
Save iddar/2907509 to your computer and use it in GitHub Desktop.
Blink on AVR Atmega328p
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
/* | |
* blink.c | |
* Blink Pin B5 on AVR Atmega328p | |
* | |
* Created on: 10/06/2012 | |
* Author: iddar Olivares | |
* Email: iddar [at] open-drain [dot] com | |
* Link: http://open-drain.com | |
*/ | |
#include <avr/io.h> | |
#include <util/delay.h> | |
int main(void) { | |
DDRB = (1<<PB5); //Pin B5 Salida | |
for(;;){ // while(1) | |
PORTB |= (1<<PB5); //Ponemos el pin en alto | |
_delay_ms(1000); | |
PORTB &= ~(1<<PB5); //Ponemos el pin en bajo | |
_delay_ms(1000); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment