Skip to content

Instantly share code, notes, and snippets.

@niklasf
Created January 21, 2014 14:16
Show Gist options
  • Save niklasf/8540887 to your computer and use it in GitHub Desktop.
Save niklasf/8540887 to your computer and use it in GitHub Desktop.
#include <avr/io.h>
void sleep(const int milliseconds) {
for (int j = 0; j < milliseconds; j++) {
for (int i = 0; i < (8000 / 18 - 28); i++);
}
}
int main()
{
DDRA = 0xFF;
PORTA = 0b11101;
while (1) {
sleep(10000);
PORTA = !PORTA;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment