Skip to content

Instantly share code, notes, and snippets.

@avr-programmierung
Created May 14, 2019 09:49
Show Gist options
  • Save avr-programmierung/5c5d6e4be1d8f4eac9b66a8b00f0f618 to your computer and use it in GitHub Desktop.
Save avr-programmierung/5c5d6e4be1d8f4eac9b66a8b00f0f618 to your computer and use it in GitHub Desktop.
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