Created
May 14, 2019 09:51
-
-
Save avr-programmierung/9dbea7d84cfd67df8971e48d3c5fabc4 to your computer and use it in GitHub Desktop.
ATmega88 @ 8MHz 10
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
/* code010.c ATmega88 @ 8MHz */ | |
#include <avr/io.h> | |
uint8_t x=7, y; | |
int main(void) | |
{ | |
/*** Hier die Abfrage in der „Normalform“ ***/ | |
if( (x <= 6) || (x >= 8) ) // Wenn x <= 6 ODER x >= 8 --> also wenn x != 7 | |
{ | |
y = 1; // y = 1, wenn x != 7 | |
} | |
else | |
{ | |
y = 2; // y = 2, wenn x = 7 | |
} | |
/*** Hier die Abfrage in der Kurzschreibweise ***/ | |
y = ( (x <= 6)||(x >= 8) ) ? 1:2; // Ist x <= 6 ODER x >= 8 ? Wenn ja,dann y=1, ansonsten y=2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment