Created
May 14, 2019 09:44
-
-
Save avr-programmierung/b15e8bc924f37af246ae3772d5959140 to your computer and use it in GitHub Desktop.
ATmega88 @ 8MHz 06
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
/* code006.c ATmega88 @ 8MHz */ | |
#include <avr/io.h> | |
uint8_t z1, z2; | |
void zaehler1(void) // Funktion zaehler1 | |
{ | |
uint8_t i = 1; | |
i++; | |
z1=i; | |
} | |
void zaehler2(void) // Funktion zaehler2 | |
{ | |
static uint8_t i = 1; // i wird als statische Variable deklariert | |
i++; | |
z2=i; | |
} | |
int main(void) | |
{ | |
zaehler1(); // Funktionsaufruf der Funktion zaehler1() | |
zaehler1(); // Funktionsaufruf der Funktion zaehler1() | |
zaehler1(); // Funktionsaufruf der Funktion zaehler1() | |
zaehler2(); // Funktionsaufruf der Funktion zaehler2() | |
zaehler2(); // Funktionsaufruf der Funktion zaehler2() | |
zaehler2(); // Funktionsaufruf der Funktion zaehler2() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment