diff options
Diffstat (limited to 'blink')
| -rw-r--r-- | blink/Makefile | 8 | ||||
| -rw-r--r-- | blink/blink.c | 16 |
2 files changed, 24 insertions, 0 deletions
diff --git a/blink/Makefile b/blink/Makefile new file mode 100644 index 0000000..a5a366a --- /dev/null +++ b/blink/Makefile @@ -0,0 +1,8 @@ + +default: + # compile for attiny86 with warnings, optimizations, and 1 MHz clock frequency + avr-gcc -Wall -Os -DF_CPU=16500000L -mmcu=attiny85 -o blink.o blink.c + avr-objcopy -j .text -j .data -O ihex blink.o blink.hex + +clean: /dev/null + rm -f blink.o blink.hex diff --git a/blink/blink.c b/blink/blink.c new file mode 100644 index 0000000..d5c9ce7 --- /dev/null +++ b/blink/blink.c @@ -0,0 +1,16 @@ + +#include <avr/eeprom.h> +#include <avr/io.h> +#include <util/delay.h> + + +int main() { + DDRB |= _BV(DDB1); + while (1) { + PORTB ^= _BV(PB1); + _delay_ms(100); + PORTB ^= _BV(PB1); + _delay_ms(900); + } +} + |
