A Pi Day project for the AT90USB162 which calculates hexadecimal digits of pi and displays them in binary on LEDs. More info at fency.fun.
Note: I am far from a C expert so this is not model C code.
-
pi.c
: Contains the actual digit calculating code to be used by other files. -
main.c
: Contains AVR code which usespi.c
to calculate digits. -
test.c
: Code which can be executed directly in a terminal (not loaded onto the microcontroller) to verify the digits produced by thepi.c
. -
USB
directory: Contains AVR + LUFA code which sends digits via USB serial instead of displaying them with LEDs.
Compiling anything for the AT90USB162 requires avr-gcc
, avr-objcopy
,
avr-size
and dfu-programmer
.
Dissasembling requires avr-obj-dump
.
Compiling the USB version requires
LUFA. The path to it needs to be
updated in USB/Makefile
.
-
make main
: Compile the main code intomain.hex
, which can be loaded onto the microcontroller. -
make test
: Compiletest.c
totest.out
. -
make usb
: Compile the contents ofUSB
, producingusb.hex
, which can be loaded onto the microcontroller.
-
make load
: Compilemain.hex
and flash it onto the microcontroller. -
make load-usb
: Compileusb.hex
and flash it onto the microcontroller.