Advertisement
Sabersense

Pulse?

Jul 8th, 2023
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.36 KB | None | 0 0
  1. ****************************************************************
  2. */
  3.  
  4. #ifdef CONFIG_TOP
  5. #include "proffieboard_v2_config.h"
  6. #define NUM_BLADES 3
  7. #define NUM_BUTTONS 2
  8.  
  9. #define VOLUME 2000
  10. // Maximum volume that can be reached via Web USB.
  11.  
  12. #define BOOT_VOLUME 1000
  13. // Default volume at bootup.
  14. // Over-ridden once user adjusts volume due to SAVE_STATE.
  15.  
  16. const unsigned int maxLedsPerStrip = 144;
  17. #define CLASH_THRESHOLD_G 4.0
  18. #define AUDIO_CLASH_SUPPRESSION_LEVEL 10
  19. #define ENABLE_AUDIO
  20. #define ENABLE_MOTION
  21. #define ENABLE_WS2811
  22. #define ENABLE_SD
  23. #define NO_REPEAT_RANDOM
  24. #define FEMALE_TALKIE_VOICE
  25. #define DYNAMIC_BLADE_LENGTH
  26. #define DYNAMIC_CLASH_THRESHOLD
  27. #define SAVE_CLASH_THRESHOLD
  28. #define SAVE_STATE
  29. #define IDLE_OFF_TIME 60 * 60 * 1000
  30. // Minutes multiplied by seconds multiplied by milliseconds. (60 * 60 * 1000 = 60 minutes).
  31.  
  32. // ---------------
  33.  
  34. // #define DISABLE_DIAGNOSTIC_COMMANDS
  35. #define ORIENTATION ORIENTATION_USB_TOWARDS_BLADE
  36. // #define ENABLE_POWER_FOR_ID PowerPINS<bladePowerPin2, bladePowerPin3>
  37. // #define FILTER_CUTOFF_FREQUENCY 100
  38. // #define FILTER_ORDER 8
  39. // #define BLADE_DETECT_PIN 8
  40.  
  41. // ---------------
  42.  
  43. // REQUIRED FOR BLUETOOTH MODULE:
  44. #define ENABLE_SERIAL
  45.  
  46. // ---------------
  47.  
  48. // REQUIRED FOR OLED MODULE.
  49. #define ENABLE_SSD1306
  50. #define OLED_FLIP_180
  51. #define PLI_OFF_TIME 60 * 1000
  52. // Controls how long battery display is shown on OLED after animations end.
  53. // Seconds multiplied by milliseconds. (60 * 1000 = 60 seconds).
  54.  
  55. // ---------------
  56.  
  57. // #define SA22C_TWIST_ON
  58. // #define SA22C_TWIST_OFF
  59. // #define SA22C_STAB_ON
  60. // #define SA22C_THRUST_ON
  61. // #define SA22C_SWING_ON
  62. // #define SA22C_FORCE_PUSH
  63. #endif
  64.  
  65. // ---------------
  66.  
  67. #ifdef CONFIG_PROP
  68. #include "../props/saber_CC_OS7_2_button.h"
  69. // #include "../props/saber_CC_OS7_1_button.h"
  70. // #include "../props/saber_CC_OS7_1_button_click.h"
  71. #endif
  72.  
  73.  
  74. // *************************************************************************
  75. #ifdef CONFIG_PRESETS
  76.  
  77. // Bluetooth Module or Crystal Motor ON Define
  78. using ON = Rgb<255,255,255>;
  79. using OFF = Rgb<0,0,0>;
  80.  
  81. Preset presets[] = {
  82.  
  83. // Preset no_blade[] = {
  84. // Preset blade[] = {
  85.  
  86. // *************************************************************************
  87.  
  88. // For OLED function, add ';Shared/oled' to each preset file list.
  89.  
  90. // **************************
  91.  
  92. { "FontPrem/Graflex;Shared/Random;Shared/Function;Shared/oled", "tracks/endtitle.wav",
  93. // Main Blade:
  94. 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>>>(),
  95.  
  96. // Test Pin:
  97. 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>>>(),
  98.  
  99. // Power LED:
  100. StylePtr<InOutHelper<Blinking<Black,Rgb<30,30,30>,700,500>,300,300,Rgb<30,30,30>>>(),
  101. "graflex"},
  102.  
  103.  
  104. // **************************
  105.  
  106.  
  107. { "FontStd1/SmthJedi;Shared/Random;Shared/Function;Shared/oled", "tracks/quigonn.wav",
  108. // Main Blade:
  109. 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>>>(),
  110.  
  111. // Test Pin:
  112. 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>>>(),
  113.  
  114. // Power LED:
  115. StylePtr<InOutHelper<Blinking<Black,Rgb<30,30,30>,700,500>,300,300,Rgb<30,30,30>>>(),
  116. "smoothjedi"},
  117.  
  118.  
  119. // **************************
  120.  
  121.  
  122. { "FontStd1/DarkSide;Shared/Vader;Shared/Function;Shared/oled", "tracks/vader.wav",
  123. // Main Blade:
  124. 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>>>(),
  125.  
  126. // Test Pin:
  127. 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>>>(),
  128.  
  129. // Power LED:
  130. StylePtr<InOutHelper<Blinking<Black,Rgb<30,30,30>,700,500>,300,300,Rgb<30,30,30>>>(),
  131. "darkside"},
  132.  
  133.  
  134. // **************************
  135.  
  136.  
  137. { "FontStd1/KbrMace;Shared/Windu;Shared/Function;Shared/oled", "tracks/windu.wav",
  138. // Main Blade:
  139. 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>>>(),
  140.  
  141. // Test Pin:
  142. 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>>>(),
  143.  
  144. // Power LED:
  145. StylePtr<InOutHelper<Blinking<Black,Rgb<30,30,30>,700,500>,300,300,Rgb<30,30,30>>>(),
  146. "mace"},
  147. // **************************
  148.  
  149.  
  150. { "FontStd2/DsplyTsy;Shared/Random;Shared/Function;Shared/oled", "tracks/jedi.wav",
  151. // Main Blade:
  152. 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>>>>(),
  153.  
  154. // Test Pin:
  155. 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>>>>(),
  156.  
  157. // Power LED:
  158. StylePtr<InOutHelper<Blinking<Black,Rgb<30,30,30>,700,500>,300,300,Rgb<30,30,30>>>(),
  159. "display"},
  160.  
  161.  
  162. // **************************
  163.  
  164.  
  165. { "FontStd2/Diagnstc;Shared/Random;Shared/Function;Shared/oled", "tracks/trail.wav",
  166. // Full range of colours.
  167. // Main Blade:
  168. 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>>>(),
  169.  
  170. // Test Pin:
  171. 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>>>(),
  172.  
  173. // Power LED:
  174. StylePtr<InOutHelper<Blinking<Black,Rgb<30,30,30>,700,500>,300,300,Rgb<30,30,30>>>(),
  175. "diagnostic"},
  176.  
  177.  
  178. // **************************
  179.  
  180.  
  181. { "FontStd2/Battery;Shared/Random;Shared/Function;Shared/oled", "tracks/rey.wav",
  182. // Main Blade:
  183. &style_charging,
  184.  
  185. // Test Pin:
  186. &style_charging,
  187.  
  188. // Power LED:
  189. StylePtr<InOutHelper<Blinking<Black,Rgb<30,30,30>,700,500>,300,300,Rgb<30,30,30>>>(),
  190. "battery"},
  191.  
  192. };
  193.  
  194.  
  195. // STANDARD 3mm ACCENTS LEDs
  196.  
  197. // 3mm Red
  198. template<int milliohms = 100000>
  199. struct RedLED {
  200. static constexpr float MaxAmps = 0.02;
  201. static constexpr float MaxVolts = 2.1;
  202. static constexpr float P2Amps = 0.01;
  203. static constexpr float P2Volts = 1.8;
  204. static constexpr float R = milliohms / 1000.0;
  205. // LED color
  206. static const int Red = 255;
  207. static const int Green = 0;
  208. static const int Blue = 0;
  209. };
  210. // *************************************************************************
  211.  
  212. // KR V2 pixel strip blade lengths:
  213. // 88cm = 132 pixels.
  214. // 82cm = 122 pixels.
  215. // 72cm = 108 pixels.
  216.  
  217.  
  218. BladeConfig blades[] = {
  219. { 0,
  220. // Main Blade:
  221. WS281XBladePtr<132, blade2Pin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3>>(),
  222. // Test Pin:
  223. WS281XBladePtr<20, bladePin, Color8::GRB, PowerPINS<bladePowerPin4>>(),
  224. // Power LED:
  225. SimpleBladePtr<RedLED<100000>, NoLED, NoLED, NoLED, bladePowerPin5, -1, -1, -1>(),
  226. CONFIGARRAY(presets) },
  227.  
  228. };
  229. #endif
  230.  
  231. #ifdef CONFIG_BUTTONS
  232. Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
  233. Button AuxButton(BUTTON_AUX, auxPin, "aux");
  234. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement