I just want my own lightsaber

As promised, heres’ the code you need…
Add this just below where you specify the prop file, between CONFIG_PROP and CONFIG_PRESETS

#ifdef CONFIG_STYLES
//  BLADE PLUG CHARGING
  class BlackPower {
    public:
  	  LayerRunResult run(BladeBase* base) {
 	  return LayerRunResult::UNKNOWN;
      }
  	  SimpleColor getColor(int led) {
  	  return SimpleColor(Color16(0,0,0));
    }
  };
#endif

Then you need to add a charging preset. You can specify any font on the SD card as it won’t actually be using it:

//  FOR BLADE PLUG CHARGING.
   { "Graflex", "tracks/mars.wav",
//  Main Blade:
ChargingStylePtr<BlackPower>(),
"charging"},

If you have any accents, just set them to:
StylePtr<Black>(),

This idea is the BlackPower blade style keeps the blade FETS powered, but the style tells them not to light anything up. This allows current to pass from the charge plug through to the battery.

Then in the charge plug you simply wire the TP4056 board’s Batt+ and Batt- terminals to the corresponding blade disc terminals (outer ring and mid ring respectively) and then fit it into an offcut of blade tube.

If you look on the thread below, there are some downloadable STL files - kindly supplied by @baldusi, so you can 3D print the plug charger components yourself. The thread shows additional pixel LEDs built into the plug charger which you can add if you want to get fancy, but you don’t have to add them as the TP4056 has its own LEDs built in to handle the blue/red status indicator automatically.

Hope that helps.
:slight_smile:

4 Likes