Created
May 14, 2019 09:25
-
-
Save avr-programmierung/e4e1d84c680231cd4c2080ac9009db57 to your computer and use it in GitHub Desktop.
ATMega88 @ 8MHz
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
/* code001.c ATMega88 @ 8MHz */ | |
#include <avr/io.h> // Einbinden der Headerdatei avr/io.h | |
#include <util/delay.h> // Einbinden der Headerdatei util/delay.h | |
int main(void) // Startpunkt eines C-Programms | |
{ | |
DDRD |= (1<<PD0); // Richtungsregister PORTD PinD0 (Pin2)auf Ausgang setzen | |
while(1) // Beginn der Endlosschleife da while(1) immer wahr ist | |
{ | |
PORTD = (1<<PD0); // Portpin PD0 setzen = HIGH | |
_delay_ms(500); // 500ms warten | |
PORTD &= ~(1<<PD0); // Portpin PD0 löschen = LOW | |
_delay_ms(500); // 500ms warten | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment