Skip to content

Instantly share code, notes, and snippets.

@avr-programmierung
Created May 14, 2019 10:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avr-programmierung/ef4b16fef1806e3a4694bcfbfca9913f to your computer and use it in GitHub Desktop.
Save avr-programmierung/ef4b16fef1806e3a4694bcfbfca9913f to your computer and use it in GitHub Desktop.
ATmega88 @ 8MHz 20
/* code020.c ATmega88 @ 8MHz */
#include <avr/io.h>
uint16_t i, j; // Zählvariablen (i und j) vom Typ Int 16-bit Wertebereich 0...65535
int main(void)
{
DDRD = (1<<PD0); // Richtungsregister Portpin D0 auf Ausgang
while(1)
{
for (i=1; i<=500; i++) // äussere Zählschleife
{
for (j=1; j<=1000; j++) // innere Zählschleife
{
}
}
PORTD ^= (1<<PD0); // Toggle Portpin D0
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment