Created
May 14, 2019 09:48
-
-
Save avr-programmierung/fc681b7ea4779cc142abac1a175c8c32 to your computer and use it in GitHub Desktop.
ATmega88 @ 8MHz 08
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
/* code008.c ATmega88 @ 8MHz */ | |
#include <avr/io.h> | |
#define LED1 (PORTD |= (1<<PD0)) // Ersetze (PORTD |= (1<<PD0)) durch LED1 | |
#define LED2 (PORTD |= (1<<PD1)) // Ersetze (PORTD |= (1<<PD1)) durch LED2 | |
#define LED3 (PORTD |= (1<<PD2)) // Ersetze (PORTD |= (1<<PD2)) durch LED3 | |
uint8_t zahl = 1; | |
int main(void) | |
{ | |
DDRD = 0xFF; // Richtungsregister gesamtes PORTD auf Ausgang | |
while(1) | |
{ | |
if (zahl == 1) | |
LED1; | |
else if (zahl == 2) | |
LED2; | |
else | |
LED3; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment