Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ****************************************************************
- */
- #ifdef CONFIG_TOP
- #include "proffieboard_v2_config.h"
- #define NUM_BLADES 3
- #define NUM_BUTTONS 2
- #define VOLUME 2000
- // Maximum volume that can be reached via Web USB.
- #define BOOT_VOLUME 1000
- // Default volume at bootup.
- // Over-ridden once user adjusts volume due to SAVE_STATE.
- const unsigned int maxLedsPerStrip = 144;
- #define CLASH_THRESHOLD_G 4.0
- #define AUDIO_CLASH_SUPPRESSION_LEVEL 10
- #define ENABLE_AUDIO
- #define ENABLE_MOTION
- #define ENABLE_WS2811
- #define ENABLE_SD
- #define NO_REPEAT_RANDOM
- #define FEMALE_TALKIE_VOICE
- #define DYNAMIC_BLADE_LENGTH
- #define DYNAMIC_CLASH_THRESHOLD
- #define SAVE_CLASH_THRESHOLD
- #define SAVE_STATE
- #define IDLE_OFF_TIME 60 * 60 * 1000
- // Minutes multiplied by seconds multiplied by milliseconds. (60 * 60 * 1000 = 60 minutes).
- // ---------------
- // #define DISABLE_DIAGNOSTIC_COMMANDS
- #define ORIENTATION ORIENTATION_USB_TOWARDS_BLADE
- // #define ENABLE_POWER_FOR_ID PowerPINS<bladePowerPin2, bladePowerPin3>
- // #define FILTER_CUTOFF_FREQUENCY 100
- // #define FILTER_ORDER 8
- // #define BLADE_DETECT_PIN 8
- // ---------------
- // REQUIRED FOR BLUETOOTH MODULE:
- #define ENABLE_SERIAL
- // ---------------
- // REQUIRED FOR OLED MODULE.
- #define ENABLE_SSD1306
- #define OLED_FLIP_180
- #define PLI_OFF_TIME 60 * 1000
- // Controls how long battery display is shown on OLED after animations end.
- // Seconds multiplied by milliseconds. (60 * 1000 = 60 seconds).
- // ---------------
- // #define SA22C_TWIST_ON
- // #define SA22C_TWIST_OFF
- // #define SA22C_STAB_ON
- // #define SA22C_THRUST_ON
- // #define SA22C_SWING_ON
- // #define SA22C_FORCE_PUSH
- #endif
- // ---------------
- #ifdef CONFIG_PROP
- #include "../props/saber_CC_OS7_2_button.h"
- // #include "../props/saber_CC_OS7_1_button.h"
- // #include "../props/saber_CC_OS7_1_button_click.h"
- #endif
- // *************************************************************************
- #ifdef CONFIG_PRESETS
- // Bluetooth Module or Crystal Motor ON Define
- using ON = Rgb<255,255,255>;
- using OFF = Rgb<0,0,0>;
- Preset presets[] = {
- // Preset no_blade[] = {
- // Preset blade[] = {
- // *************************************************************************
- // For OLED function, add ';Shared/oled' to each preset file list.
- // **************************
- { "FontPrem/Graflex;Shared/Random;Shared/Function;Shared/oled", "tracks/endtitle.wav",
- // Main Blade:
- StylePtr<Layers<Layers<ColorChange<TrInstant,DeepSkyBlue,Blue,Cyan,DodgerBlue,Green,Rgb<28,255,28>,Red,Magenta,Rgb<255,80,154>,Yellow,Orange,Rgb<185,212,212>>,RandomL<ColorChange<TrInstant,Rgb<0,107,205>,Rgb<0,0,205>,Rgb<0,205,205>,Rgb<0,60,205>,Rgb<0,205,0>,Rgb<22,205,22>,Rgb<205,0,0>,Rgb<205,0,205>,Rgb<205,62,115>,Rgb<205,205,0>,Rgb<205,79,0>,Rgb<178,205,205>>>>,TransitionEffectL<TrConcat<TrInstant,BrownNoiseFlickerL<AlphaL<White,Int<16000>>,Int<50>>,TrSmoothFade<600>>,EFFECT_LOCKUP_END>,LockupTrL<Strobe<White,Black,25,28>,TrConcat<TrInstant,White,TrFade<200>>,TrFade<300>,SaberBase::LOCKUP_NORMAL>,LockupTrL<AlphaL<White,LayerFunctions<Bump<Scale<SlowNoise<Int<2000>>,Int<3000>,Int<16000>>,Scale<BrownNoiseF<Int<10>>,Int<14000>,Int<8000>>>,Bump<Scale<SlowNoise<Int<2300>>,Int<26000>,Int<8000>>,Scale<NoisySoundLevel,Int<5000>,Int<10000>>>,Bump<Scale<SlowNoise<Int<2300>>,Int<20000>,Int<30000>>,Scale<IsLessThan<SlowNoise<Int<1500>>,Int<8000>>,Scale<NoisySoundLevel,Int<5000>,Int<0>>,Int<0>>>>>,TrConcat<TrInstant,AlphaL<White,Bump<Int<12000>,Int<18000>>>,TrFade<200>>,TrConcat<TrInstant,HumpFlickerL<AlphaL<White,Int<16000>>,30>,TrSmoothFade<600>>,SaberBase::LOCKUP_LIGHTNING_BLOCK>,ResponsiveStabL<Red>,BlastL<LemonChiffon>,SimpleClashL<Strobe<Yellow,Black,25,28>,200>,LockupTrL<AlphaL<BrownNoiseFlickerL<White,Int<300>>,SmoothStep<Int<30000>,Int<5000>>>,TrWipeIn<400>,TrFade<300>,SaberBase::LOCKUP_DRAG>,LockupTrL<AlphaL<Mix<TwistAngle<>,RandomFlicker<Red,Black>,RandomFlicker<Yellow,Red>>,SmoothStep<Int<28000>,Int<5000>>>,TrWipeIn<600>,TrFade<300>,SaberBase::LOCKUP_MELT>,InOutTrL<TrWipe<800>,TrWipeIn<1000>>,TransitionEffectL<TrConcat<TrWipe<1000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrDelay<2000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrWipeIn<1000>>,EFFECT_BATTERY_LEVEL>>>(),
- // Test Pin:
- StylePtr<Layers<Layers<ColorChange<TrInstant,DeepSkyBlue,Blue,Cyan,DodgerBlue,Green,Rgb<28,255,28>,Red,Magenta,Rgb<255,80,154>,Yellow,Orange,Rgb<185,212,212>>,RandomL<ColorChange<TrInstant,Rgb<0,107,205>,Rgb<0,0,205>,Rgb<0,205,205>,Rgb<0,60,205>,Rgb<0,205,0>,Rgb<22,205,22>,Rgb<205,0,0>,Rgb<205,0,205>,Rgb<205,62,115>,Rgb<205,205,0>,Rgb<205,79,0>,Rgb<178,205,205>>>>,TransitionEffectL<TrConcat<TrInstant,BrownNoiseFlickerL<AlphaL<White,Int<16000>>,Int<50>>,TrSmoothFade<600>>,EFFECT_LOCKUP_END>,LockupTrL<Strobe<White,Black,25,28>,TrConcat<TrInstant,White,TrFade<200>>,TrFade<300>,SaberBase::LOCKUP_NORMAL>,LockupTrL<AlphaL<White,LayerFunctions<Bump<Scale<SlowNoise<Int<2000>>,Int<3000>,Int<16000>>,Scale<BrownNoiseF<Int<10>>,Int<14000>,Int<8000>>>,Bump<Scale<SlowNoise<Int<2300>>,Int<26000>,Int<8000>>,Scale<NoisySoundLevel,Int<5000>,Int<10000>>>,Bump<Scale<SlowNoise<Int<2300>>,Int<20000>,Int<30000>>,Scale<IsLessThan<SlowNoise<Int<1500>>,Int<8000>>,Scale<NoisySoundLevel,Int<5000>,Int<0>>,Int<0>>>>>,TrConcat<TrInstant,AlphaL<White,Bump<Int<12000>,Int<18000>>>,TrFade<200>>,TrConcat<TrInstant,HumpFlickerL<AlphaL<White,Int<16000>>,30>,TrSmoothFade<600>>,SaberBase::LOCKUP_LIGHTNING_BLOCK>,ResponsiveStabL<Red>,BlastL<LemonChiffon>,SimpleClashL<Strobe<Yellow,Black,25,28>,200>,LockupTrL<AlphaL<BrownNoiseFlickerL<White,Int<300>>,SmoothStep<Int<30000>,Int<5000>>>,TrWipeIn<400>,TrFade<300>,SaberBase::LOCKUP_DRAG>,LockupTrL<AlphaL<Mix<TwistAngle<>,RandomFlicker<Red,Black>,RandomFlicker<Yellow,Red>>,SmoothStep<Int<28000>,Int<5000>>>,TrWipeIn<600>,TrFade<300>,SaberBase::LOCKUP_MELT>,InOutTrL<TrWipe<800>,TrWipeIn<1000>>,TransitionEffectL<TrConcat<TrWipe<1000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrDelay<2000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrWipeIn<1000>>,EFFECT_BATTERY_LEVEL>>>(),
- // Power LED:
- StylePtr<InOutHelper<Blinking<Black,Rgb<30,30,30>,700,500>,300,300,Rgb<30,30,30>>>(),
- "graflex"},
- // **************************
- { "FontStd1/SmthJedi;Shared/Random;Shared/Function;Shared/oled", "tracks/quigonn.wav",
- // Main Blade:
- StylePtr<Layers<ColorChange<TrInstant,Green,Rgb<28,255,28>,Red,Magenta,Rgb<255,80,154>,Yellow,Orange,Azure,DeepSkyBlue,Blue,Cyan,DodgerBlue>,RandomL<ColorChange<TrInstant,Rgb<0,205,0>,Rgb<22,205,22>,Rgb<205,0,0>,Rgb<205,0,205>,Rgb<205,62,115>,Rgb<205,205,0>,Rgb<205,79,0>,Rgb<178,205,205>,Rgb<0,107,205>,Rgb<0,0,205>,Rgb<0,205,205>,Rgb<0,60,205>>>,AlphaL<AudioFlickerL<ColorChange<TrInstant,Green,Rgb<28,255,28>,Red,Magenta,Rgb<255,80,154>,Yellow,Orange,Azure,DeepSkyBlue,Blue,Cyan,DodgerBlue>>,SwingSpeed<400>>,ResponsiveLightningBlockL<Strobe<White,AudioFlicker<White,Blue>,50,1>,TrConcat<TrInstant,AlphaL<White,Bump<Int<12000>,Int<18000>>>,TrFade<200>>,TrConcat<TrInstant,HumpFlickerL<AlphaL<White,Int<16000>>,30>,TrSmoothFade<600>>>,TransitionEffectL<TrConcat<TrInstant,BrownNoiseFlickerL<AlphaL<White,Int<16000>>,Int<50>>,TrSmoothFade<600>>,EFFECT_LOCKUP_END>,LockupL<Strobe<ColorChange<TrInstant,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Yellow,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>>,Black,20,16>,Strobe<ColorChange<TrInstant,White,White,White,White,White,Red,Rgb<200,255,255>,Red,White,White,White,White>,Black,20,16>>,ResponsiveStabL<Red>,BlastFadeoutL<White,280>,SimpleClashL<Strobe<Yellow,Black,25,28>,300>,LockupTrL<AlphaL<BrownNoiseFlickerL<White,Int<300>>,SmoothStep<Int<30000>,Int<5000>>>,TrWipeIn<400>,TrFade<300>,SaberBase::LOCKUP_DRAG>,LockupTrL<AlphaL<Mix<TwistAngle<>,Red,DarkOrange>,SmoothStep<Int<28000>,Int<5000>>>,TrWipeIn<600>,TrFade<300>,SaberBase::LOCKUP_MELT>,InOutTrL<TrWipe<800>,TrWipeIn<900>>,TransitionEffectL<TrDelay<10000>,EFFECT_PREON>,TransitionEffectL<TrConcat<TrWipe<1000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrDelay<2000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrWipeIn<1000>>,EFFECT_BATTERY_LEVEL>>>(),
- // Test Pin:
- StylePtr<Layers<ColorChange<TrInstant,Green,Rgb<28,255,28>,Red,Magenta,Rgb<255,80,154>,Yellow,Orange,Azure,DeepSkyBlue,Blue,Cyan,DodgerBlue>,RandomL<ColorChange<TrInstant,Rgb<0,205,0>,Rgb<22,205,22>,Rgb<205,0,0>,Rgb<205,0,205>,Rgb<205,62,115>,Rgb<205,205,0>,Rgb<205,79,0>,Rgb<178,205,205>,Rgb<0,107,205>,Rgb<0,0,205>,Rgb<0,205,205>,Rgb<0,60,205>>>,AlphaL<AudioFlickerL<ColorChange<TrInstant,Green,Rgb<28,255,28>,Red,Magenta,Rgb<255,80,154>,Yellow,Orange,Azure,DeepSkyBlue,Blue,Cyan,DodgerBlue>>,SwingSpeed<400>>,ResponsiveLightningBlockL<Strobe<White,AudioFlicker<White,Blue>,50,1>,TrConcat<TrInstant,AlphaL<White,Bump<Int<12000>,Int<18000>>>,TrFade<200>>,TrConcat<TrInstant,HumpFlickerL<AlphaL<White,Int<16000>>,30>,TrSmoothFade<600>>>,TransitionEffectL<TrConcat<TrInstant,BrownNoiseFlickerL<AlphaL<White,Int<16000>>,Int<50>>,TrSmoothFade<600>>,EFFECT_LOCKUP_END>,LockupL<Strobe<ColorChange<TrInstant,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Yellow,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>>,Black,20,16>,Strobe<ColorChange<TrInstant,White,White,White,White,White,Red,Rgb<200,255,255>,Red,White,White,White,White>,Black,20,16>>,ResponsiveStabL<Red>,BlastFadeoutL<White,280>,SimpleClashL<Strobe<Yellow,Black,25,28>,300>,LockupTrL<AlphaL<BrownNoiseFlickerL<White,Int<300>>,SmoothStep<Int<30000>,Int<5000>>>,TrWipeIn<400>,TrFade<300>,SaberBase::LOCKUP_DRAG>,LockupTrL<AlphaL<Mix<TwistAngle<>,Red,DarkOrange>,SmoothStep<Int<28000>,Int<5000>>>,TrWipeIn<600>,TrFade<300>,SaberBase::LOCKUP_MELT>,InOutTrL<TrWipe<800>,TrWipeIn<900>>,TransitionEffectL<TrDelay<10000>,EFFECT_PREON>,TransitionEffectL<TrConcat<TrWipe<1000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrDelay<2000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrWipeIn<1000>>,EFFECT_BATTERY_LEVEL>>>(),
- // Power LED:
- StylePtr<InOutHelper<Blinking<Black,Rgb<30,30,30>,700,500>,300,300,Rgb<30,30,30>>>(),
- "smoothjedi"},
- // **************************
- { "FontStd1/DarkSide;Shared/Vader;Shared/Function;Shared/oled", "tracks/vader.wav",
- // Main Blade:
- StylePtr<Layers<Layers<ColorChange<TrInstant,Red,Magenta,Rgb<255,80,154>,Yellow,Orange,Azure,DeepSkyBlue,Blue,Cyan,DodgerBlue,Green,Rgb<28,255,28>>,RandomL<ColorChange<TrInstant,Rgb<205,0,0>,Rgb<205,0,205>,Rgb<205,62,115>,Rgb<205,205,0>,Rgb<205,79,0>,Rgb<178,205,205>,Rgb<0,107,205>,Rgb<0,0,205>,Rgb<0,205,205>,Rgb<0,60,205>,Rgb<0,205,0>,Rgb<22,205,22>>>,RandomL<ColorChange<TrInstant,Rgb<125,0,0>,Rgb<125,0,125>,Rgb<125,40,77>,Rgb<125,125,0>,Rgb<125,48,0>,Rgb<110,125,125>,Rgb<0,68,125>,Rgb<0,0,125>,Rgb<0,125,125>,Rgb<0,35,125>,Rgb<0,125,0>,Rgb<14,125,14>>>>,BlastL<ColorChange<TrInstant,LightYellow,Blue,Blue,Red,Blue,Red,Red,Red,Red,Red,Red,Red>>,LockupL<Strobe<ColorChange<TrInstant,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Yellow,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>>,Black,20,16>,Strobe<ColorChange<TrInstant,White,White,White,Red,Rgb<200,255,255>,Red,White,White,White,White,White,White>,Black,20,16>>,LockupTrL<AlphaL<Mix<TwistAngle<>,RandomFlicker<Red,Black>,RandomFlicker<Yellow,Red>>,SmoothStep<Int<28000>,Int<5000>>>,TrWipeIn<600>,TrFade<300>,SaberBase::LOCKUP_MELT>,SimpleClashL<Strobe<ColorChange<TrInstant,Yellow,Yellow,Yellow,Cyan,White,Yellow,Yellow,Yellow,Yellow,Yellow,LemonChiffon,Red>,Black,28,25>,260>,InOutHelperL<InOutFuncX<Int<600>,Int<1100>>>,TransitionEffectL<TrConcat<TrWipe<1000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrDelay<2000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrWipeIn<1000>>,EFFECT_BATTERY_LEVEL>>>(),
- // Test Pin:
- StylePtr<Layers<Layers<ColorChange<TrInstant,Red,Magenta,Rgb<255,80,154>,Yellow,Orange,Azure,DeepSkyBlue,Blue,Cyan,DodgerBlue,Green,Rgb<28,255,28>>,RandomL<ColorChange<TrInstant,Rgb<205,0,0>,Rgb<205,0,205>,Rgb<205,62,115>,Rgb<205,205,0>,Rgb<205,79,0>,Rgb<178,205,205>,Rgb<0,107,205>,Rgb<0,0,205>,Rgb<0,205,205>,Rgb<0,60,205>,Rgb<0,205,0>,Rgb<22,205,22>>>,RandomL<ColorChange<TrInstant,Rgb<125,0,0>,Rgb<125,0,125>,Rgb<125,40,77>,Rgb<125,125,0>,Rgb<125,48,0>,Rgb<110,125,125>,Rgb<0,68,125>,Rgb<0,0,125>,Rgb<0,125,125>,Rgb<0,35,125>,Rgb<0,125,0>,Rgb<14,125,14>>>>,BlastL<ColorChange<TrInstant,LightYellow,Blue,Blue,Red,Blue,Red,Red,Red,Red,Red,Red,Red>>,LockupL<Strobe<ColorChange<TrInstant,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Yellow,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>>,Black,20,16>,Strobe<ColorChange<TrInstant,White,White,White,Red,Rgb<200,255,255>,Red,White,White,White,White,White,White>,Black,20,16>>,LockupTrL<AlphaL<Mix<TwistAngle<>,RandomFlicker<Red,Black>,RandomFlicker<Yellow,Red>>,SmoothStep<Int<28000>,Int<5000>>>,TrWipeIn<600>,TrFade<300>,SaberBase::LOCKUP_MELT>,SimpleClashL<Strobe<ColorChange<TrInstant,Yellow,Yellow,Yellow,Cyan,White,Yellow,Yellow,Yellow,Yellow,Yellow,LemonChiffon,Red>,Black,28,25>,260>,InOutHelperL<InOutFuncX<Int<600>,Int<1100>>>,TransitionEffectL<TrConcat<TrWipe<1000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrDelay<2000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrWipeIn<1000>>,EFFECT_BATTERY_LEVEL>>>(),
- // Power LED:
- StylePtr<InOutHelper<Blinking<Black,Rgb<30,30,30>,700,500>,300,300,Rgb<30,30,30>>>(),
- "darkside"},
- // **************************
- { "FontStd1/KbrMace;Shared/Windu;Shared/Function;Shared/oled", "tracks/windu.wav",
- // Main Blade:
- StylePtr<Layers<Layers<ColorChange<TrInstant,Magenta,Rgb<255,80,154>,Yellow,Orange,Azure,DeepSkyBlue,Blue,Cyan,DodgerBlue,Green,Rgb<28,255,28>,Red>,RandomL<ColorChange<TrInstant,Rgb<125,0,125>,Rgb<125,40,77>,Rgb<125,125,0>,Rgb<125,48,0>,Rgb<110,125,125>,Rgb<0,68,125>,Rgb<0,0,125>,Rgb<0,125,125>,Rgb<0,35,125>,Rgb<0,125,0>,Rgb<14,125,14>,Rgb<125,0,0>>>,RandomL<ColorChange<TrInstant,Rgb<62,0,62>,Rgb<62,20,38>,Rgb<62,62,0>,Rgb<62,24,0>,Rgb<56,62,62>,Rgb<0,34,62>,Rgb<0,0,62>,Rgb<0,62,62>,Rgb<0,18,62>,Rgb<0,62,0>,Rgb<7,62,7>,Rgb<62,0,0>>>>,BlastL<ColorChange<TrInstant,Blue,Blue,Red,Blue,Red,Red,Red,Red,Red,Red,Red,LightYellow>>,LockupL<Strobe<ColorChange<TrInstant,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Yellow,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>>,Black,20,16>,Strobe<ColorChange<TrInstant,White,White,Red,Rgb<200,255,255>,Red,White,White,White,White,White,White,White>,Black,20,16>>,LockupTrL<AlphaL<Mix<TwistAngle<>,RandomFlicker<Red,Black>,RandomFlicker<Yellow,Red>>,SmoothStep<Int<28000>,Int<5000>>>,TrWipeIn<600>,TrFade<300>,SaberBase::LOCKUP_MELT>,SimpleClashL<Strobe<ColorChange<TrInstant,Yellow,Yellow,Cyan,White,Yellow,Yellow,Yellow,Yellow,Yellow,LemonChiffon,Red,Yellow>,Black,28,25>,260>,InOutHelperL<InOutFuncX<Int<800>,Int<1050>>>,TransitionEffectL<TrConcat<TrWipe<1000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrDelay<2000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrWipeIn<1000>>,EFFECT_BATTERY_LEVEL>>>(),
- // Test Pin:
- StylePtr<Layers<Layers<ColorChange<TrInstant,Magenta,Rgb<255,80,154>,Yellow,Orange,Azure,DeepSkyBlue,Blue,Cyan,DodgerBlue,Green,Rgb<28,255,28>,Red>,RandomL<ColorChange<TrInstant,Rgb<125,0,125>,Rgb<125,40,77>,Rgb<125,125,0>,Rgb<125,48,0>,Rgb<110,125,125>,Rgb<0,68,125>,Rgb<0,0,125>,Rgb<0,125,125>,Rgb<0,35,125>,Rgb<0,125,0>,Rgb<14,125,14>,Rgb<125,0,0>>>,RandomL<ColorChange<TrInstant,Rgb<62,0,62>,Rgb<62,20,38>,Rgb<62,62,0>,Rgb<62,24,0>,Rgb<56,62,62>,Rgb<0,34,62>,Rgb<0,0,62>,Rgb<0,62,62>,Rgb<0,18,62>,Rgb<0,62,0>,Rgb<7,62,7>,Rgb<62,0,0>>>>,BlastL<ColorChange<TrInstant,Blue,Blue,Red,Blue,Red,Red,Red,Red,Red,Red,Red,LightYellow>>,LockupL<Strobe<ColorChange<TrInstant,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Yellow,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>>,Black,20,16>,Strobe<ColorChange<TrInstant,White,White,Red,Rgb<200,255,255>,Red,White,White,White,White,White,White,White>,Black,20,16>>,LockupTrL<AlphaL<Mix<TwistAngle<>,RandomFlicker<Red,Black>,RandomFlicker<Yellow,Red>>,SmoothStep<Int<28000>,Int<5000>>>,TrWipeIn<600>,TrFade<300>,SaberBase::LOCKUP_MELT>,SimpleClashL<Strobe<ColorChange<TrInstant,Yellow,Yellow,Cyan,White,Yellow,Yellow,Yellow,Yellow,Yellow,LemonChiffon,Red,Yellow>,Black,28,25>,260>,InOutHelperL<InOutFuncX<Int<800>,Int<1050>>>,TransitionEffectL<TrConcat<TrWipe<1000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrDelay<2000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrWipeIn<1000>>,EFFECT_BATTERY_LEVEL>>>(),
- // Power LED:
- StylePtr<InOutHelper<Blinking<Black,Rgb<30,30,30>,700,500>,300,300,Rgb<30,30,30>>>(),
- "mace"},
- // **************************
- { "FontStd2/DsplyTsy;Shared/Random;Shared/Function;Shared/oled", "tracks/jedi.wav",
- // Main Blade:
- StylePtr<InOutHelper<SimpleClash<Lockup<Blast<ColorChange<TrInstant,Rgb<0,68,125>,Rgb<0,0,125>,Rgb<0,125,125>,Rgb<0,35,125>,Rgb<0,125,0>,Rgb<14,125,14>,Rgb<125,0,0>,Rgb<125,0,125>,Rgb<125,40,77>,Rgb<125,125,0>,Rgb<125,48,0>,Rgb<110,125,125>>,White>,RandomFlicker<Blue,White>>,White>,300,800,ColorChange<TrInstant,Rgb<0,68,125>,Rgb<0,0,125>,Rgb<0,125,125>,Rgb<0,35,125>,Rgb<0,125,0>,Rgb<14,125,14>,Rgb<125,0,0>,Rgb<125,0,125>,Rgb<125,40,77>,Rgb<125,125,0>,Rgb<125,48,0>,Rgb<110,125,125>>>>(),
- // Test Pin:
- StylePtr<InOutHelper<SimpleClash<Lockup<Blast<ColorChange<TrInstant,Rgb<0,68,125>,Rgb<0,0,125>,Rgb<0,125,125>,Rgb<0,35,125>,Rgb<0,125,0>,Rgb<14,125,14>,Rgb<125,0,0>,Rgb<125,0,125>,Rgb<125,40,77>,Rgb<125,125,0>,Rgb<125,48,0>,Rgb<110,125,125>>,White>,RandomFlicker<Blue,White>>,White>,300,800,ColorChange<TrInstant,Rgb<0,68,125>,Rgb<0,0,125>,Rgb<0,125,125>,Rgb<0,35,125>,Rgb<0,125,0>,Rgb<14,125,14>,Rgb<125,0,0>,Rgb<125,0,125>,Rgb<125,40,77>,Rgb<125,125,0>,Rgb<125,48,0>,Rgb<110,125,125>>>>(),
- // Power LED:
- StylePtr<InOutHelper<Blinking<Black,Rgb<30,30,30>,700,500>,300,300,Rgb<30,30,30>>>(),
- "display"},
- // **************************
- { "FontStd2/Diagnstc;Shared/Random;Shared/Function;Shared/oled", "tracks/trail.wav",
- // Full range of colours.
- // Main Blade:
- StylePtr<InOutHelper<Cyan,300,800,ColorSequence<1250,DodgerBlue,Green,Rgb<28,255,28>,Red,Magenta,Rgb<255,80,154>,Yellow,Orange,Azure,DeepSkyBlue,Blue,Cyan>>>(),
- // Test Pin:
- StylePtr<InOutHelper<Cyan,300,800,ColorSequence<1250,DodgerBlue,Green,Rgb<28,255,28>,Red,Magenta,Rgb<255,80,154>,Yellow,Orange,Azure,DeepSkyBlue,Blue,Cyan>>>(),
- // Power LED:
- StylePtr<InOutHelper<Blinking<Black,Rgb<30,30,30>,700,500>,300,300,Rgb<30,30,30>>>(),
- "diagnostic"},
- // **************************
- { "FontStd2/Battery;Shared/Random;Shared/Function;Shared/oled", "tracks/rey.wav",
- // Main Blade:
- &style_charging,
- // Test Pin:
- &style_charging,
- // Power LED:
- StylePtr<InOutHelper<Blinking<Black,Rgb<30,30,30>,700,500>,300,300,Rgb<30,30,30>>>(),
- "battery"},
- };
- // STANDARD 3mm ACCENTS LEDs
- // 3mm Red
- template<int milliohms = 100000>
- struct RedLED {
- static constexpr float MaxAmps = 0.02;
- static constexpr float MaxVolts = 2.1;
- static constexpr float P2Amps = 0.01;
- static constexpr float P2Volts = 1.8;
- static constexpr float R = milliohms / 1000.0;
- // LED color
- static const int Red = 255;
- static const int Green = 0;
- static const int Blue = 0;
- };
- // *************************************************************************
- // KR V2 pixel strip blade lengths:
- // 88cm = 132 pixels.
- // 82cm = 122 pixels.
- // 72cm = 108 pixels.
- BladeConfig blades[] = {
- { 0,
- // Main Blade:
- WS281XBladePtr<132, blade2Pin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3>>(),
- // Test Pin:
- WS281XBladePtr<20, bladePin, Color8::GRB, PowerPINS<bladePowerPin4>>(),
- // Power LED:
- SimpleBladePtr<RedLED<100000>, NoLED, NoLED, NoLED, bladePowerPin5, -1, -1, -1>(),
- CONFIGARRAY(presets) },
- };
- #endif
- #ifdef CONFIG_BUTTONS
- Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
- Button AuxButton(BUTTON_AUX, auxPin, "aux");
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement