Created
May 14, 2019 10:03
-
-
Save avr-programmierung/2efcf75e22f1a84c1f6be3adb1e688f2 to your computer and use it in GitHub Desktop.
ATmega88 @ 8MHz 18
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
/* code018.c ATmega88 @ 8MHz */ | |
#include <avr/io.h> | |
#include <util/delay.h> | |
int main(void) | |
{ | |
DDRD = 0xFF; | |
while(1) | |
{ | |
PORTD = (1<<PD0); // Bit D0 setzen --> 0000 0001 | |
_delay_ms(200); // 200ms warten | |
for (uint8_t i=0; i<=6; i++) // for-Schleife für 7 Durchläufe | |
{ | |
PORTD = (PORTD << 1); // PORTD um 1 nach links verschieben | |
_delay_ms(200); // 200ms warten | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment