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
/* code010.c ATmega88 @ 8MHz */ | |
#include <avr/io.h> | |
uint8_t x=7, y; | |
int main(void) | |
{ | |
/*** Hier die Abfrage in der „Normalform“ ***/ | |
if( (x <= 6) || (x >= 8) ) // Wenn x <= 6 ODER x >= 8 --> also wenn x != 7 |
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) |
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
/* code012.c ATmega88 @ 8MHz */ | |
#include <avr/io.h> | |
uint8_t addiere(uint8_t zahl); // Funktions Prototypen | |
void mult(uint8_t summe); // Funktions Prototypen | |
void ausgabe(uint8_t summe); // Funktions Prototypen | |
uint8_t addiere(uint8_t zahl) | |
{ | |
zahl += 5; |
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
// Datei main.c | |
/* code013.c ATmega88 @ 8MHz */ | |
#include <avr/io.h> | |
#include "main.h" // Bindet die Headerdatei main.h ein | |
#include "sub.h" // Bindet die Headerdatei sub.h ein | |
#include "mult.h" // Bindet die Headerdatei mult.h ein | |
int main(void) | |
{ | |
uint8_ta=4, b=2, ergebnis; |
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
/* code014.c ATmega88 @ 8MHz */ | |
#include <avr/io.h> | |
uint8_t counter; | |
int main(void) | |
{ | |
DDRD = 0xFF; | |
PORTD = 0x00; | |
counter = 100; |
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
/* code015.c ATmega88 @ 8MHz */ | |
#include <avr/io.h> | |
uint32_t counter = 100000; | |
int main(void) | |
{ | |
DDRD = 0xFF; | |
PORTD = 0x00; | |
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
/* code016.c ATmega88 @ 8MHz */ | |
#include <avr/io.h> | |
#include <avr/interrupt.h> // Einbinden von interrupt.h (Interrupt Funktionen) | |
#include <avr/wdt.h> // Einbinden von wdt.h (Watchdog Funktionen) | |
uint8_t counter = 100; | |
int main(void) | |
{ | |
DDRD = 0xFF; |
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
/* code017.c ATmega88 @ 8MHz */ | |
#include <avr/io.h> | |
int main(void) | |
{ | |
DDRD = 0xFF; | |
PORTD = (1<<PD0); // Bit D0 setzen --> 0000 0001 | |
while(1) | |
{ |
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
/* code018.c ATmega88 @ 8MHz */ | |
#include <avr/io.h> | |
#include <util/delay.h> | |
int main(void) | |
{ | |
DDRD = 0xFF; | |
while(1) | |
{ |
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
/* code019.c ATmega88 @ 8MHz */ | |
#include <avr/io.h> | |
#include <util/delay.h> | |
int main(void) | |
{ | |
DDRD = 0xFF; | |
uint8_t i; | |
while(1) |