Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* 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
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement