NoSloppy

nate2

Jul 20th, 2022 (edited)
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.43 KB | None | 0 0
  1. #ifdef CONFIG_TOP
  2. #include "proffieboard_v2_config.h"
  3. #define NUM_BLADES 6
  4. #define NUM_BUTTONS 2
  5. #define VOLUME 1250
  6. const unsigned int maxLedsPerStrip = 144;
  7. #define CLASH_THRESHOLD_G 7
  8. #define ENABLE_AUDIO
  9. #define ENABLE_MOTION
  10. #define ENABLE_WS2811
  11. #define ENABLE_SD
  12. // #define ENABLE_SSD1306
  13. #define COLOR_CHANGE_DIRECT
  14. // this enables "click to change"
  15. #define SA22C_SWING_ON
  16. #define SA22C_TWIST_OFF
  17. #define SA22C_FORCE_PUSH
  18. // #define GESTURE_AUTO_BATTLE_MODE
  19. #define DISABLE_DIAGNOSTIC_COMMANDS
  20. #define IDLE_OFF_TIME 60 * 5 * 1000
  21. #define MOTION_TIMEOUT 60 * 5 * 1000
  22. #define ENABLE_SPINS
  23. #define NO_REPEAT_RANDOM
  24. #define DISABLE_BASIC_PARSER_STYLES
  25. // #define SAVE_STATE
  26. #define ORIENTATION ORIENTATION_USB_TOWARDS_BLADE
  27.  
  28. #endif
  29.  
  30. #ifdef CONFIG_PROP
  31. #include "../props/saber_sa22c_buttons.h"
  32. #endif
  33.  
  34. //FET 1- Bottom Strip
  35. //FET 2- Main Blade & CC
  36. //FET 3- Main Blade & CC
  37. //FET 4- Yellow Accent LED
  38. //FET 5- YellowGreen Accent LED
  39. //FET 6- Green Accent LED
  40.  
  41. //Data 1- Npx CC 5px
  42. //Data 2- Main Blade
  43.  
  44. #ifdef CONFIG_PRESETS
  45. Preset presets[] = {
  46. { "Ezra", "tracks/track1.wav",
  47. // Main Blade
  48. StylePtr<Layers<Mix<HoldPeakF<SwingSpeed<250>,Scale<SwingAcceleration<100>,Int<50>,Int<500>>,Scale<SwingAcceleration<>,Int<20000>,Int<10000>>>,RandomFlicker<StripesX<Int<24000>,Scale<HoldPeakF<SwingSpeed<200>,Scale<SwingAcceleration<100>,Int<50>,Int<300>>,Scale<SwingAcceleration<100>,Int<24000>,Int<16000>>>,Int<-1400>,Int<-100>>,RgbArg<BASE_COLOR_ARG,Rgb<30,255,0>>,RgbArg<BASE_COLOR_ARG,Rgb<30,255,0>>,Mix<Int<7710>,Black,RgbArg<BASE_COLOR_ARG,Rgb<30,255,0>>>,RgbArg<BASE_COLOR_ARG,Rgb<30,255,0>>,Mix<Int<19276>,Black,RgbArg<BASE_COLOR_ARG,Rgb<30,255,0>>>>,RgbArg<BASE_COLOR_ARG,Rgb<30,255,0>>>,RgbArg<BASE_COLOR_ARG,Rgb<30,255,0>>>,TransitionEffectL<TrConcat<TrInstant,AudioFlickerL<RgbArg<IGNITION_COLOR_ARG,Rgb<255,255,255>>>,TrFade<1200>>,EFFECT_IGNITION>,TransitionEffectL<TrConcat<TrJoin<TrDelayX<WavLen<>>,TrWipeIn<200>>,AlphaL<AudioFlickerL<RgbArg<STAB_COLOR_ARG,Rgb<255,255,255>>>,SmoothStep<IntArg<MELT_SIZE_ARG,28000>,Int<2000>>>,TrWipe<200>>,EFFECT_STAB>,TransitionEffectL<TrWaveX<RgbArg<BLAST_COLOR_ARG,Rgb<255,199,119>>,Scale<WavLen<>,Int<100>,Int<400>>,Int<100>,Scale<WavLen<>,Int<100>,Int<400>>,Scale<EffectPosition<EFFECT_BLAST>,Int<28000>,Int<8000>>>,EFFECT_BLAST>,Mix<IsLessThan<ClashImpactF<>,Int<26000>>,TransitionEffectL<TrConcat<TrInstant,AlphaL<RgbArg<CLASH_COLOR_ARG,Rgb<255,199,119>>,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-10000>>>,Scale<ClashImpactF<>,Int<12000>,Int<60000>>>>,TrFadeX<Scale<ClashImpactF<>,Int<200>,Int<400>>>>,EFFECT_CLASH>,TransitionEffectL<TrWaveX<RgbArg<CLASH_COLOR_ARG,Rgb<255,199,119>>,Scale<ClashImpactF<>,Int<100>,Int<400>>,Int<100>,Scale<ClashImpactF<>,Int<100>,Int<400>>,Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-10000>>>>,EFFECT_CLASH>>,LockupTrL<TransitionEffect<AlphaMixL<Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-10000>>>,Scale<SwingSpeed<100>,Int<14000>,Int<18000>>>,BrownNoiseFlickerL<RgbArg<LOCKUP_COLOR_ARG,Rgb<255,199,119>>,Int<200>>,StripesX<Int<1800>,Scale<NoisySoundLevel,Int<-3500>,Int<-5000>>,Mix<Int<6425>,Black,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,199,119>>>,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,199,119>>,Mix<Int<12850>,Black,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,199,119>>>>>,AlphaL<AudioFlicker<RgbArg<LOCKUP_COLOR_ARG,Rgb<255,199,119>>,Mix<Int<10280>,Black,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,199,119>>>>,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-10000>>>,Int<13000>>>,TrJoin<TrDelay<8000>,TrInstant>,TrFade<3000>,EFFECT_LOCKUP_BEGIN>,TrConcat<TrJoin<TrDelay<50>,TrInstant>,Mix<IsLessThan<ClashImpactF<>,Int<26000>>,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,199,119>>,AlphaL<RgbArg<LOCKUP_COLOR_ARG,Rgb<255,199,119>>,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-10000>>>,Scale<ClashImpactF<>,Int<20000>,Int<60000>>>>>,TrFade<300>>,TrConcat<TrInstant,AlphaL<RgbArg<LOCKUP_COLOR_ARG,Rgb<255,199,119>>,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-10000>>>,Int<13000>>>,TrFade<400>>,SaberBase::LOCKUP_NORMAL>,ResponsiveLightningBlockL<Strobe<RgbArg<LB_COLOR_ARG,Rgb<85,85,200>>,AudioFlicker<RgbArg<LB_COLOR_ARG,Rgb<85,85,200>>,Blue>,50,1>,TrConcat<TrInstant,AlphaL<RgbArg<LB_COLOR_ARG,Rgb<85,85,200>>,Bump<Int<12000>,Int<18000>>>,TrFade<200>>,TrConcat<TrInstant,HumpFlickerL<AlphaL<RgbArg<LB_COLOR_ARG,Rgb<85,85,200>>,Int<16000>>,30>,TrSmoothFade<600>>>,LockupTrL<AlphaL<RandomPerLEDFlickerL<RgbArg<DRAG_COLOR_ARG,Rgb<255,255,255>>>,SmoothStep<IntArg<DRAG_SIZE_ARG,28000>,Int<3000>>>,TrConcat<TrJoin<TrDelay<4000>,TrWipeIn<200>>,AlphaL<BrownNoiseFlickerL<RgbArg<DRAG_COLOR_ARG,Rgb<255,255,255>>,Int<300>>,SmoothStep<IntArg<DRAG_SIZE_ARG,28000>,Int<3000>>>,TrFade<4000>>,TrFade<300>,SaberBase::LOCKUP_DRAG>,LockupTrL<AlphaL<Remap<Scale<RampF,Int<65536>,Int<0>>,StaticFire<Mix<TwistAngle<>,RgbArg<STAB_COLOR_ARG,Rgb<255,24,0>>,RotateColorsX<Int<3000>,RgbArg<STAB_COLOR_ARG,Rgb<255,24,0>>>>,Mix<TwistAngle<>,RotateColorsX<Int<3000>,RgbArg<STAB_COLOR_ARG,Rgb<255,24,0>>>,RotateColorsX<Int<3000>,Mix<Int<12000>,Black,RgbArg<STAB_COLOR_ARG,Rgb<255,24,0>>>>>,0,3,5,3000,10>>,SmoothStep<IntArg<MELT_SIZE_ARG,28000>,Int<4000>>>,TrConcat<TrWipeIn<100>,AlphaL<RgbArg<STAB_COLOR_ARG,Rgb<255,24,0>>,SmoothStep<IntArg<MELT_SIZE_ARG,28000>,Int<4000>>>,TrJoin<TrDelay<4000>,TrFade<300>>,AlphaL<Mix<TwistAngle<>,RgbArg<STAB_COLOR_ARG,Rgb<255,24,0>>,RotateColorsX<Int<3000>,RgbArg<STAB_COLOR_ARG,Rgb<255,24,0>>>>,SmoothStep<IntArg<MELT_SIZE_ARG,28000>,Int<4000>>>,TrFade<4000>>,TrWipe<200>,SaberBase::LOCKUP_MELT>,InOutTrL<TrWipeX<IgnitionTime<300>>,TrWipeInX<RetractionTime<0>>,Black>>>(),
  49. // Crystal
  50. StylePtr<Layers<
  51. StyleFire<RgbArg<BASE_COLOR_ARG,Green>,Rgb<100,255,100>,0,2,FireConfig<0,1500,0>,FireConfig<3000,0,0>,FireConfig<0,5000,10>,FireConfig<0,1500,0>>,
  52. TransitionEffectL<TrConcat<TrInstant,White,TrFade<200>>,EFFECT_IGNITION>,
  53. TransitionEffectL<TrConcat<TrInstant,RgbArg<BLAST_COLOR_ARG,White>,TrFade<200>>,EFFECT_BLAST>,
  54. LockupL<AudioFlicker<OnSpark<StyleFire<RgbArg<LOCKUP_COLOR_ARG,Green>,Rgb<100,255,100>,0,2,FireConfig<0,1500,0>,FireConfig<3000,0,0>,FireConfig<0,5000,10>,FireConfig<0,0,5>>>,White>>,
  55. TransitionEffectL<TrConcat<TrInstant,RgbArg<CLASH_COLOR_ARG,White>,TrDelay<40>>,EFFECT_CLASH>,
  56. LockupTrL<Pulsing<BrownNoiseFlicker<Red,Black,300>,Yellow,2000>,TrFade<300>,TrFade<300>,SaberBase::LOCKUP_MELT>,
  57. InOutTrL<TrFade<1000>,TrFade<500>,Sparkle<Black,White,7>>>>(),
  58. // Bottom Strip
  59. StylePtr<Layers<Mix<Bump<Sin<Int<180>>,Int<20000>>,Black,RotateColorsX<Variation,DarkOrange>>,LockupTrL<AudioFlickerL<DarkOrange>,TrInstant,TrFade<500>,SaberBase::LOCKUP_NORMAL>,InOutTrL<TrFade<500>,TrFade<500>,Mix<Bump<Sin<Int<18>>,Int<20000>>,Black,RotateColorsX<Variation,DarkOrange>>>>>(),
  60. // // 3mm Yellow
  61. // StylePtr<Layers<
  62. // Black,
  63. // TransitionLoopL<TrConcat<TrInstant,White,TrDelay<400>,Black,TrDelay<100>>>,
  64. // InOutTrL<TrInstant,TrInstant,Blinking<Black,White,1500,500>>>>(),
  65. // // 3mm YellowGreen
  66. // StylePtr<Layers<
  67. // Black,
  68. // TransitionLoopL<TrConcat<TrDelay<100>,White,TrDelay<300>,Black,TrDelay<100>>>,
  69. // InOutTrL<TrInstant,TrInstant,Blinking<Black,White,1500,500>>>>(),
  70. // // 3mm Green
  71. // StylePtr<Layers<
  72. // Black,
  73. // TransitionLoopL<TrConcat<TrDelay<200>,White,TrDelay<200>,Black,TrDelay<100>>>,
  74. // InOutTrL<TrInstant,TrInstant,Blinking<Black,White,1500,500>>>>(),
  75. StylePtr<InOutHelper<Blinking<Black,White,1500,500>, 1, 1, Sequence<White, Black, 90, 30, 0b1111110,0b0000000000000000>>>(),
  76. StylePtr<InOutHelper<Blinking<Black,White,1500,500>, 1, 1, Sequence<White, Black, 90, 30, 0b0011110,0b0000000000000000>>>(),
  77. StylePtr<InOutHelper<Blinking<Black,White,1500,500>, 1, 1, Sequence<White, Black, 90, 30, 0b0000110,0b0000000000000000>>>(),
  78. "ezra"
  79. }
  80. };
  81.  
  82. BladeConfig blades[] = {
  83. { 0, // blade ID resistor not used
  84. // Main Blade & Crystal Sub 123 LEDs Data 1 Power 2/3
  85. SubBlade(1, 122, WS281XBladePtr<123, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >()),
  86. SubBlade(0, 0, NULL),
  87. // Bottom Strip 10 LEDs Data 2 Power 1
  88. WS281XBladePtr<10, blade2Pin, Color8::GRB, PowerPINS<bladePowerPin1> >(),
  89. // 3mm Yellow LED Data NA Power 4
  90. SimpleBladePtr<CreeXPE2WhiteTemplate<100>, NoLED, NoLED, NoLED, bladePowerPin4, -1, -1, -1>(),
  91. // 3mm YellowGreen LED Data NA Power 5
  92. SimpleBladePtr<CreeXPE2WhiteTemplate<100>, NoLED, NoLED, NoLED, bladePowerPin5, -1, -1, -1>(),
  93. // 3mm Green LED Data NA Power 6
  94. SimpleBladePtr<CreeXPE2WhiteTemplate<100>, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(),
  95. CONFIGARRAY(presets) }
  96. };
  97. #endif
  98.  
  99. #ifdef CONFIG_BUTTONS
  100. Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
  101. Button AuxButton(BUTTON_AUX, auxPin, "aux");
  102. #endif
Add Comment
Please, Sign In to add comment