Advertisement
NoSloppy

Untitled

May 7th, 2022
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.88 KB | None | 0 0
  1. #ifdef CONFIG_TOP
  2. #include "proffieboard_v1_config.h"
  3. #define NUM_BLADES 3
  4. #define NUM_BUTTONS 2
  5. #define VOLUME 1111
  6. const unsigned int maxLedsPerStrip = 144;
  7. #define CLASH_THRESHOLD_G 3.0
  8. #define ENABLE_AUDIO
  9. #define ENABLE_MOTION
  10. #define ENABLE_WS2811
  11. #define ENABLE_SD
  12. #define ENABLE_SERIAL
  13. #define DISABLE_DIAGNOSTIC_COMMANDS
  14. #define IDLE_OFF_TIME 60 * 5 * 1000
  15. #define MOTION_TIMEOUT 60 * 5 * 1000
  16. #define NO_REPEAT_RANDOM
  17.  
  18. #endif
  19.  
  20. #ifdef CONFIG_PRESETS
  21. Preset presets[] = {
  22.  
  23. { "a_LUKE/LS6;common", "a_LUKE/LS6/tracks/jabba_scene.wav",
  24. StylePtr<Layers<
  25. // Main Blade Color/Styles Base
  26. AudioFlicker<RotateColorsX<Variation,Green>,RotateColorsX<Variation,Rgb<0,128,0>>>,
  27. // Clash 1 - BladeAngle responsive. Yellowish impact
  28. TransitionEffectL<TrConcat<TrInstant,GreenYellow,TrDelay<25>,AlphaL<TransitionEffect<BrownNoiseFlicker<Rgb<255,150,0>,Black,50>,White,TrInstant,TrFade<300>,EFFECT_CLASH>,Bump<Scale<BladeAngle<>,Int<25000>,Int<8000>>,Int<18000>>>,TrFade<600>>,EFFECT_CLASH>,
  29. // Stab - OrangeRed stripes
  30. TransitionEffectL<TrConcat<TrInstant,GreenYellow,TrDelay<25>,AlphaL<Black,Int<0>>,TrWipeIn<300>,AlphaL<Stripes<5000,1000,Orange,DarkOrange,Rgb<150,60,0>,Rgb<60,30,0>,Rgb<150,14,0>,OrangeRed>,SmoothStep<Int<20000>,Int<20000>>>,TrJoin<TrSmoothFade<900>,TrWipe<700>>>,EFFECT_STAB>,
  31. // Blast
  32. TransitionEffectL<TrConcat<
  33. // Impact Flash - BC always
  34. TrInstant,GreenYellow,TrDelay<25>>,EFFECT_BLAST>,
  35. // Waves
  36. BlastL<White,850,250,351>,
  37. // Impact point afterimage
  38. AlphaL<TransitionEffectL<TrConcat<TrFade<300>,Rgb<255,70,70>,TrFade<300>>,EFFECT_BLAST>,BlastF<700,250,100000>>,
  39. // Impact point
  40. BlastL<White,300,350,100000>,
  41. // Lockup 1 - BC custom range mid-blade to hilt w/random strobe flash
  42. TransitionEffectL<TrConcat<TrInstant,Strobe<GreenYellow,Black,20,30>,TrFade<200>,BrownNoiseFlickerL<AlphaL<White,Int<16000>>,Int<5000>>,TrJoinR<TrWipe<200>,TrWipeIn<200>,TrFade<300>>>,EFFECT_LOCKUP_END>,
  43. LockupTrL<Layers<
  44. //Random Strobe Flash no dimming
  45. AlphaL<TransitionLoopL<TrConcat<TrDelayX<Scale<SlowNoise<Int<3000>>,Int<30>,Int<800>>>,Mix<SlowNoise<Int<1000>>,Black,Black,White,Black>,TrDelayX<Scale<SlowNoise<Int<1000>>,Int<10>,Int<50>>>>>,Int<32768>>,
  46. //AlphaL<White,StrobeF<Scale<SlowNoise<Int<1000>>,Int<1>,Int<3>>,Scale<SlowNoise<Int<1000>>,Int<10>,Int<50>>>>,
  47. // Bottom Layer Bump - random width
  48. AlphaL<Blinking<Tomato,Strobe<Yellow,Black,15,30>,60,500>, Bump<Scale<BladeAngle<5000,28000>,Scale<BladeAngle<8000,16000>,Int<3000>,Int<44000>>,Int<3000>>,Scale<SlowNoise<Int<3000>>,Int<8000>,Int<18000>>>>,
  49. // Top Layer Bump - fixed width
  50. AlphaL<Blinking<BrownNoiseFlicker<White,Black,50>,BrownNoiseFlicker<Yellow,Tomato,50>,100,500>, Bump<Scale<BladeAngle<5000,28000>,Scale<BladeAngle<8000,16000>,Int<3000>,Int<44000>>,Int<3000>>,Int<9000>>>>,
  51. // Begin Lockup Transition
  52. TrConcat<TrInstant,AlphaL<Blinking<White,Strobe<BrownNoiseFlicker<Yellow,Black,500>,Black,15,30>,60,500>,Bump<Scale<BladeAngle<5000,28000>,Scale<BladeAngle<8000,16000>,Int<3000>,Int<44000>>,Int<3000>>,Scale<SlowNoise<Int<3000>>,Int<25000>,Int<32000>>>>,TrFade<500>>,
  53. // End Lockup Transition
  54. TrSmoothFade<900>,SaberBase::LOCKUP_NORMAL>,
  55. TransitionEffectL<TrConcat<TrInstant,AlphaL<Strobe<GreenYellow,Black,20,30>, Bump<Scale<BladeAngle<5000,28000>,Scale<BladeAngle<8000,16000>,Int<3000>,Int<44000>>,Int<3000>>,Int<15000>>>,TrFade<600>>,EFFECT_LOCKUP_BEGIN>,
  56. TransitionEffectL<TrConcat<TrInstant,GreenYellow,TrDelay<25>,HumpFlickerL<Strobe<AlphaL<White,Int<20000>>,Black,20,30>,30>,TrSmoothFade<225>>,EFFECT_LOCKUP_BEGIN>,
  57. // Non-Responsive Drag - BC custom drag fadeout
  58. LockupTrL<AlphaL<AudioFlicker<BrownNoiseFlicker<Strobe<Black,OrangeRed,20,25>,Yellow,200>,White>,SmoothStep<Int<30000>,Int<2000>>>,TrConcat<TrInstant,GreenYellow,TrDelay<25>,AlphaL<Black,Int<0>>,TrFade<150>>,TrColorCycle<1500,-2000,100>,SaberBase::LOCKUP_DRAG>,
  59. // Lightning Block - Non-responsive. BC custom color (purple hint w/ random strobe flashes because....lightning)
  60. LockupTrL<Layers<
  61. //Random Strobe Flash and 16000 = 50% base blade dimming to make lb pop
  62. AlphaL<Black,Int<16000>>,
  63. AlphaL<White,StrobeF<Scale<SlowNoise<Int<1000>>,Int<1>,Int<6>>,Scale<SlowNoise<Int<1000>>,Int<10>,Int<50>>>>,
  64. AlphaL<RandomFlicker<Strobe<White,Rgb<83,0,255>,50,10>,BrownNoiseFlicker<Rgb<83,0,255>,Black,500>>,LayerFunctions<
  65. Bump<Scale<SlowNoise<Int<2000>>,Int<3000>,Int<16000>>,Scale<BrownNoiseF<Int<10>>,Int<14000>,Int<8000>>>,
  66. Bump<Scale<SlowNoise<Int<2300>>,Int<26000>,Int<8000>>,Scale<NoisySoundLevel,Int<5000>,Int<10000>>>,
  67. Bump<Scale<SlowNoise<Int<2300>>,Int<20000>,Int<30000>>,Scale<IsLessThan<SlowNoise<Int<1500>>,Int<8000>>,Scale<NoisySoundLevel,Int<5000>,Int<0>>,Int<0>>>>>>,
  68. // Begin Lightning Transition
  69. TrConcat<TrInstant,GreenYellow,TrDelay<25>,BrownNoiseFlicker<Rgb<83,0,255>,Black,500>,TrFade<100>>,
  70. // End Lightning Transition
  71. TrConcat<TrInstant,GreenYellow,TrDelay<25>,BrownNoiseFlicker<Rgb<83,0,255>,Black,500>,TrFade<150>,BrownNoiseFlickerL<AlphaL<White,Int<16000>>,Int<50>>,TrJoinR<TrWipe<200>,TrWipeIn<200>,TrFade<400>> >,SaberBase::LOCKUP_LIGHTNING_BLOCK>,
  72. // Melt - BC custom melt effects, uses twistangle<>
  73. LockupTrL<
  74. // OS 6 (Based on "Intensity Melt" - Fett263. Remap Fire to travel tip->emitter, Custom Begin and End Transitions)
  75. AlphaL<Remap<Scale<RampF,Int<65536>,Int<0>>,StaticFire<Mix<TwistAngle<>,Rgb16<20393,93,93>,DarkOrange>,Mix<TwistAngle<>,Rgb16<20393,93,93>,Orange>,0,4,5,4000,10>>,
  76. // Melt Shape
  77. SmoothStep<Scale<TwistAngle<>,Int<24000>,Int<29000>>,Int<4000>>>,
  78. // Melt Begin and End transitions
  79. TrConcat<TrInstant,GreenYellow,TrDelay<25>,AlphaL<Black,Int<0>>,TrWipeIn<600>,AlphaL<Red,SmoothStep<Scale<TwistAngle<>,Int<24000>,Int<29000>>,Int<2000>>>,TrExtend<3000,TrFade<300>>,AlphaL<Mix<TwistAngle<>,Red,Orange>,SmoothStep<Scale<TwistAngle<>,Int<24000>,Int<29000>>,Int<2000>>>,TrFade<3000>>,TrColorCycle<1500,-2000>,SaberBase::LOCKUP_MELT>,
  80. InOutTrL<TrWipeSparkTip<White,250>,TrWipeInX<WavLen<EFFECT_RETRACTION>>>,
  81. // On-Demand Battery Level
  82. AlphaL<TransitionEffectL<TrConcat<TrSmoothFade<500>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<Scale<BatteryLevel,Int<0>,Int<35000>>,Int<-1>>>,TrDelay<1000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<Scale<BatteryLevel,Int<0>,Int<35000>>,Int<-1>>>,TrSmoothFade<1000>>,EFFECT_BATTERY_LEVEL>,Ifon<Int<0>,Int<32768>>>
  83. >>(),
  84.  
  85. // Red Arrow Blinks when blade is ON
  86. StylePtr<InOutHelper<Blinking<Black,Rgb<130,130,130>,1500,500>, 1, 1, Sequence<Rgb<130,130,130>, Black, 200, 30, 0b0000000000000000,0b0010101010101000>>>(),
  87.  
  88. // Green Arrow
  89. StylePtr<InOutHelper<Rgb<85,85,85>, 1, 1, Sequence<Rgb<85,85,85>, Black, 200, 30, 0b1010101010101010,0b1000000000000000>>>(),
  90. "luke\nskywalker"},
  91.  
  92.  
  93. };
  94.  
  95. struct AccentsLED {
  96. static constexpr float MaxAmps = 0.02;
  97. static constexpr float MaxVolts = 3.2;
  98. static constexpr float P2Amps = 0.015;
  99. static constexpr float P2Volts = 3.0;
  100. static constexpr float R = 0; // Resistor value
  101. static const int Red = 255;
  102. static const int Green = 255;
  103. static const int Blue = 255;
  104. };
  105.  
  106. BladeConfig blades[] = {
  107. { 0, WS281XBladePtr<144, bladePin, Color8::GRB, PowerPINS<bladePowerPin1, bladePowerPin2, bladePowerPin3>>(), // Chamber Bottom
  108. SimpleBladePtr<AccentsLED, NoLED, NoLED, NoLED, bladePowerPin5, -1, -1, -1>(), // Red Arrow
  109. SimpleBladePtr<AccentsLED, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(), // Green Arrow
  110. CONFIGARRAY(presets)},
  111. };
  112. #endif
  113.  
  114. #ifdef CONFIG_BUTTONS
  115. Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
  116. Button AuxButton(BUTTON_AUX, auxPin, "aux");
  117. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement