Weird glitchy behavior I assume is power related?
Config:
// This is a sample configuration file.
// This saber has:
// o TeensySaber V3 hardware.
// o Two buttons
// o An XP-E2 RGB LED star.
// If you have a saber similar to this one, make a copy and use the copy.
// This is also the default configuration file. Pre-programmed boards will
// use this configuration file.
#ifdef CONFIG_TOP
#include "v4_config.h"
#define NUM_BLADES 1
#define NUM_BUTTONS 2
#define VOLUME 2200
const unsigned int maxLedsPerStrip = 30;
#define CLASH_THRESHOLD_G 1.0
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define GYRO_CLASS MPU6050
#define ENABLE_SD
#endif
#ifdef CONFIG_PRESETS
Preset presets[] = {
{ "TeensySF", "tracks/mars.wav",
StyleNormalPtr<CYAN, WHITE, 300, 800>(), "cyan"},
{ "TeensySF", "tracks/mars.wav",
StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(), "blue"},
{ "TeensySF", "tracks/mars.wav",
StyleNormalPtr<RED, WHITE, 300, 800>(), "red"},
{ "TeensySF", "tracks/mars.wav",
StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >(), "green"},
{ "TeensySF", "tracks/mars.wav",
StyleNormalPtr<WHITE, RED, 300, 800, RED>(), "white"},
{ "TeensySF", "tracks/mars.wav",
StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>(), "yellow"},
{ "TeensySF", "tracks/mars.wav",
StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(), "magenta"},
{ "TeensySF", "tracks/mars.wav",
StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>(), "strobe"}
};
BladeConfig blades[] = {
{0, WS2811BladePtr<30, WS2811_GRB>(), CONFIGARRAY(presets) },
};
#endif
#ifdef CONFIG_BUTTONS
Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
Button AuxButton(BUTTON_AUX, auxPin, "aux");
#endif
Serial Monitor:
Sdcard found..
blade= 0
WS2811 Blade with 30 leds.
Failed to open: presets.ini
Failed to open: presets.tmp
Style RAM = 216
Scanning sound font: TeensySF done
Activating polyphonic font.
Activating SmoothSwing V2
Accent Swings NOT Detected:
unit = 0 vol = 0.50, Playing TeensySF/boot.wav
channels: 1 rate: 44100 bits: 16
Welcome to ProffieOS $Id: ce12a06a1e236b5101ec60c950530a9a4719a74d $. Type 'help' for more info.
Audio underflows: 21
Amplifier off.
I2C TRY
I2C pullups found, initializing...
Motion setup ... done.
EVENT: Aux-Pressed#1 millis=6593
EVENT: Aux-Pressed millis=6593
EVENT: Aux-Released#1 millis=6714
EVENT: Aux-Released millis=6714
EVENT: Aux-Shortclick#1 millis=6714
EVENT: Aux-Shortclick millis=6714
Failed to open: presets.ini
Failed to open: presets.tmp
Style RAM = 232
Scanning sound font: TeensySF done
Activating polyphonic font.
Activating SmoothSwing V2
Accent Swings NOT Detected:
DISPLAY: blue
unit = 0 vol = 0.50, Playing TeensySF/font.wav
channels: 1 rate: 44100 bits: 16
Amplifier off.
EVENT: Power-Pressed#1 millis=10135
EVENT: Power-Pressed millis=10135
EVENT: Power-Released#1 millis=10260
EVENT: Power-Released millis=10260
EVENT: Power-Shortclick#1 millis=10260
EVENT: Power-Shortclick millis=10260
Ignition.
unit = 0 vol = 0.00, Playing TeensySF/hum01.wav
channels: 1 rate: 44100 bits: 16
unit = 1 vol = 0.50, Playing TeensySF/out01.wav
channels: 1 rate: 44100 bits: 16
humstart: 1890
unit = 2 vol = 0.00, Playing TeensySF/swingl02.wav
channels: 1 rate: 44100 bits: 16
unit = 3 vol = 0.00, Playing TeensySF/swingh02.wav
channels: 1 rate: 44100 bits: 16
Motion chip timeout, reboot motion chip!
Motion setup ... done.
Motion chip timeout, reboot motion chip!
Motion setup ... done.
Playing TeensySF/swingh02.wav
channels: 1 rate: 44100 bits: 16
Playing TeensySF/swingl02.wav
channels: 1 rate: 44100 bits: 16
unit = 3 vol = 0.00, Playing TeensySF/swingl07.wav
channels: 1 rate: 44100 bits: 16
unit = 2 vol = 0.00, Playing TeensySF/swingh07.wav
channels: 1 rate: 44100 bits: 16
Motion chip timeout, reboot motion chip!
Motion setup ... failed.
Motion chip timeout, reboot motion chip!
Motion setup ... failed.
Motion chip timeout, reboot motion chip!
Motion setup ... failed.
Motion chip timeout, reboot motion chip!
Motion setup ... failed.
Motion chip timeout, reboot motion chip!
Motion setup ... failed.
Motion chip timeout, reboot motion chip!
Motion setup ... failed.
Battery voltage: 0.00
Motion chip timeout, reboot motion chip!
Motion setup ...