Skip to content

tullo-x86/led-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Radio-synced LED controllers

Hardware requirements

Project setup

  1. Install Visual Studio Code
  2. Install the PlatformIO IDE extension from VSCode's Marketplace (Ctrl+P, then ext install platformio.platformio-ide)
  3. Restart VSCode, give it time to update itself, then use PlatformIO's "Open Project" to load the project (it will automatically download and install the needed compiler toolchain)
  4. Follow any prompts from PlatformIO to ensure that your PC is able to communicate with the AVR programmer
  5. Plug the FTDI programmer into the board to be programmed, then connect the programmer to the PC
  6. From PlatformIO's sidebar panel, under "Project Tasks", select "Build" to compile, or "Upload" to compile and then program the board. You should see output like this:
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [========= ]  92.4% (used 1893 bytes from 2048 bytes)
Flash: [======    ]  59.6% (used 19210 bytes from 32256 bytes)
Configuring upload protocol...
AVAILABLE: arduino
CURRENT: upload_protocol = arduino
Looking for upload port...
Auto-detected: /dev/ttyUSB0
Uploading .pio/build/miniwireless/firmware.hex

⚠️ If you see an error that reads the following:

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00

Then your programmer is not getting an answer from the chip it's trying to program. Ensure that it's plugged all the way in, and isn't connected backwards. Most boards have protection against reverse polarity, including these Anarduino ones, but not all engineers are fond of idiot-proofing things.

Project notes

  • All memory is allocated statically. Don't use new or malloc — declare larger objects globally so that static analysis can show you the amount of stack memory you have to play with.
  • Between RadioHead and the LED buffers, a good two-thirds of the controller's memory is already reserved, so all of the light patterns renderers are stateless. They render the output values deterministically, based on the passed-in DrawState which contains:
    • The current timestamp
    • The timestamp of when the trigger was last pulled
    • The timestamp of when the trigger was last released
    • The current position of the joystick's X-axis