Created
May 14, 2019 09:52
-
-
Save avr-programmierung/a6e52fd17a233056455dc2ddf4a052e8 to your computer and use it in GitHub Desktop.
ATmega88 @ 8MHz 11
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
/* code011.c ATmega88 @ 8MHz */ | |
#include <avr/io.h> | |
uint8_t addiere(uint8_t zahl) // (2) | |
{ | |
zahl += 5; // (3) | |
return zahl; // (4) | |
} | |
void ausgabe(uint8_t summe) // (6) | |
{ | |
summe *= 2; // (7) | |
PORTD = summe; // (8) | |
} | |
int main(void) | |
{ | |
DDRD = 0xFF; // PORTD auf Ausgang | |
PORTD = 0x00; // PORTD = Low | |
uint8_t summe = addiere(2); // (1) | |
ausgabe(summe); // (5) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment