Created
May 14, 2019 09:49
-
-
Save avr-programmierung/5c5d6e4be1d8f4eac9b66a8b00f0f618 to your computer and use it in GitHub Desktop.
ATmega88 @ 8MHz 09
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
/* code009.c ATmega88 @ 8MHz */ | |
#include <avr/io.h> | |
uint8_t x=10, y; | |
int main(void) | |
{ | |
/*** Hier die Abfrage in der „Normalform“ ***/ | |
if(x > 8) | |
{ | |
y = 1; | |
} | |
else | |
{ | |
y = 2; | |
} | |
/*** Hier die Abfrage in der Kurzschreibweise ***/ | |
y = (x > 8) ? 1:2; // Ist 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