Repo for LayerOne 2024
The Pov Spinner is an electronic fidget spinner that displays words and patterns via LED's when spinning. It was part of the LayerOne 2024 Conference badge.
- Code from repo
- Computer
- AVR programming device
- Build software
- Flash software
- Device drivers
Clone the git repo or download the zip of the repo
git clone https://github.com/charlie-x/LayerOne_2024.git
wget https://github.com/charlie-x/LayerOne_2024/archive/refs/heads/main.zip
Open the L12024POV.cproj project file.
The text and animation code is located in main.c.
Once the desired changes are complete, run the build. This will output the build files into the Debug folder.
The L12024POV.hex file created is what will be used to flash the spinner.
NOTE: Any AVR programmer should work.
The LayerOne attendees were able to obtain a Kraken AVR programmer to use for this purpose which is an avrisp/mkii/avr dragon/usbasp.
Kraken based on this board:
Alternatively, and Ardunio can be used to program the device:
https://docs.arduino.cc/built-in-examples/arduino-isp/ArduinoISP/
https://www.amazon.com/CANADUINO-USBtinyISP-Programmer-Compatible-Arduino/dp/B0751LJH3Z
Either use Microchip Studio or avr-gcc to build it.
Install avr-gcc via the gcc-avr package
sudo apt-get install binutils gcc-avr avr-libc uisp avrdude flex byacc bison
https://www.microchip.com/en-us/tools-resources/develop/microchip-studio
port
https://ports.macports.org/port/avr-gcc/
homebrew
https://github.com/osx-cross/homebrew-avr
for avr-gcc's use the makefile
NOTE: The kraken needs avrdude, it is not supported in microchip studio.
AVRDUDE - is a program for downloading and uploading the on-chip memories of Microchip’s AVR microcontrollers.
Flash the board with the compiled hex file to device
https://github.com/avrdudes/avrdude/releases
avrdude -c usbasp -p t4313 -v -B 3 -U flash:w:..\LayerOne_2024-main\LayerOne_2024-main\L1_POVSpinner\L12024POV\Debug\L12024POV.hex
atprogram - is a program that comes with Microchip Studio
atprogram -cl 200khz -v -d attiny4313 -t atmelice -i isp chiperase
atprogram -cl 200khz -v -d attiny4313 -t atmelice -i isp program -f L12024POV\Release\L12024POV.elf
Zadig is a Windows application that installs generic USB drivers, such as WinUSB, libusb-win32/libusb0.sys or libusbK, to help you access USB devices that can be found here: https://zadig.akeo.ie/#
Install the libusbK driver
The device has the Ground pin labeld as G.
The image folder are made of 12xN high 1 bit png's and the imageConvert tool spits them out as a header file, just include them and use drawImage
imageConvert <in.png> <out.h>
use to pass into drawImage use #include <out.h> (with the right name) in the main.c
interrupt driven from a hall effect sensor, triggers the loops to draw and calcs an RPM then it goes into sleep after the effect is drawn, the hall effect can wake it up, but to save battery pressing the button wakes the cpu up again
the slider switch needs to be be in the furthest away position from the programming pads, match the G to gnd on the programmer..
==============================================================================
calculate x/y
30 is 360/nuber of leds around, which is speed dependant so used the number of leds vertically
angle_radians = ( led_number * 30 *pi / 180 )
x_inner = radius * cos ( angle_radius ) y_inner = radius * cos ( angle_radius )
distance...
distance = sqrt( (dx^2) + (dy^2))