Skip to content

Rave-Saber/Rave-Saber-Firmware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RaveSaber - AVR Firmware

Build Status

Firmware for AVR microcontrollers that drives a Dotstar LED strip in the RaveSaber lightsaber.

This code is responsible for defining available patterns and handling button presses(toggling power & switching patterns). The pattern rendering code lives in our APA102 Library.

Usage

Connect your programmer to your ATmega168a chip and run make flash. If you want to change or re-order the colors, modify src/main.c and re-flash your chip. We use the USBtinyISP programmer along with all 144 LEDs, but you can change this by modifying the variables in the Makefile.

The firmware assumes you are using a 16Mhz crystal oscillator. If you are running a different clock frequency, change F_CPU in the Makefile. You can enable the external oscillator fuses by running make set_fuses and set them back to the default with make reset_fuses. You may need to change the fuse definitions in the Makefile if you want to use those commands with different ATmega chips.

Once your microcontroller is hooked up to the rest of the hardware, you can long-press the button to toggle power & short-press the button to cycle patterns.

TODO

  • Setup, Usage, & API docs.
  • Power saving
    • Take measurements of LED & MCU current draws to establish baseline.
    • Use avr power saving modes(when off or single step pattern) w/ button press wake-ups(only stay woken up if we pass a button threshold).
    • Use timers for delays so we can sleep during steps?
    • Disable unused peripherals.
  • Save/Load Patterns to/from EEPROM or SD Card.
  • Bluetooth module + desktop or tablet app to control saber & modify patterns interactively.

License

GPL-3.0