Skip to content

Instantly share code, notes, and snippets.

@avr-programmierung
Created May 14, 2019 09:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
ATmega88 @ 8MHz 09
/* 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