Last active
June 26, 2016 01:26
-
-
Save owskio/bc9d0bb0e5ac862bb0ac517b5fdda169 to your computer and use it in GitHub Desktop.
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
/* | |
# Arrangement: atmega16a, isp style protoboard programmer with littlewire kit | |
# Purpose: to help me remember cli flags and values for the avr toolchain | |
sudo avr-gcc -Wall blink.c -mmcu=atmega16a -o blink.o | |
sudo avr-objcopy -O ihex -R .eeprom blink.o blink.hex | |
sudo avrdude -p atmega16 -c usbtiny -U flash:w:blink.hex | |
*/ | |
#define F_CPU 1000000UL // 1 MHz clock speed | |
#include <avr/io.h> | |
#include <util/delay.h> | |
int main(void) { | |
DDRA = 0xFF; //Makes all port pins output | |
while(1) { | |
PORTA = 0xFF; //raises All pins on port | |
_delay_ms(100); | |
PORTA = 0x00; //lowers all pins on port | |
_delay_ms(900); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment