Advertisement
saber-fights

PM_v1.0_test.h

May 5th, 2022
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.80 KB | None | 0 0
  1. /*
  2. * This is the config file for the Saberz Project M saber.
  3. * Specs:
  4. * Proffieboard V2.2
  5. * Li-Ion 18650 3.7V 15A 3120mAh PCB Protected Rechargeable Battery
  6. * 28mm speaker
  7. */
  8.  
  9.  
  10. #ifdef CONFIG_TOP
  11. #include "proffieboard_v2_config.h"
  12. #define NUM_BLADES 1// Only one blade per each hilt (no accents)
  13. #define NUM_BUTTONS 2// Uses two buttons
  14. #define VOLUME 2800//M aximum recommended volume is 3000
  15. const unsigned int maxLedsPerStrip = 269;
  16. #define CLASH_THRESHOLD_G 3.0
  17. #define ENABLE_AUDIO
  18. #define ENABLE_MOTION
  19. #define ENABLE_WS2811
  20. #define ENABLE_SD
  21. #define SAVE_PRESET// Saves the current font preset after kill-key engaged.
  22. #define ENABLE_SERIAL
  23. #define ENABLE_SSD1306
  24. #define IDLE_OFF_TIME 60 * 5 * 1000//shuts off power to all blades after 5 minutes, to help conserve battery when idle.
  25. #define DISABLE_COLOR_CHANGE
  26. #define FETT263_BATTLE_MODE_ALWAYS_ON
  27. // Battle Mode is always on, toggle controls deactivated
  28. // This will disable traditional Clash and Stab effects
  29. // (cannot be used with FETT263_BATTLE_MODE_START_ON)
  30. // Battle Mode is the mode in which Clash and Stab effects are automated by the OS
  31. #define FETT263_LOCKUP_DELAY 200
  32. // This is the "delay" in millis to determine Clash vs Lockup
  33. // Increase this value by 100 if too much bounce is experienced during clashes
  34. #endif
  35.  
  36. //inlcludes customized button mapping.
  37. #ifdef CONFIG_PROP
  38. //#include "../props/saber_shtok_buttons.h"
  39. #include "../props/saber_fett263_buttons.h"
  40. #endif
  41.  
  42. #ifdef CONFIG_PRESETS
  43.  
  44.  
  45. Preset presets[] =
  46. {
  47.  
  48.  
  49. {
  50. "Menace", "tracks/fates.wav",
  51. //Main Blade
  52.  
  53. /* copyright Fett263 Simple (Primary Blade) OS6 Style
  54. https://fett263.com/fett263-proffieOS6-style-library.html#Simple
  55. OS6.7 v4.01
  56. Single Style
  57. Base Style: HumpFlicker Small (Single Color (50%))
  58.  
  59. Base Color: Rgb<255,0,0> (0)
  60.  
  61. --Effects Included--
  62. Ignition Effect: Standard Ignition
  63. Retraction Effect: Standard Retraction
  64. CoolDown Effect: Power Flash
  65. Lockup Effect: Responsive Lockup, Begin Effect: Real Clash, End Effect: Localized Absorb
  66. LightningBlock Effect: Responsive Lightning Block
  67. Drag Effect: Intensity Sparking Drag
  68. Melt Effect: Responsive Melt
  69. Stab Effect: AudioFlicker Stab
  70. Clash Effect: Responsive Clash
  71. */
  72. StylePtr<Layers<HumpFlicker<RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>,Mix<Int<16448>,Black,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>,60>,TransitionEffectL<TrConcat<TrJoin<TrDelayX<RetractionTime<0>>,TrInstant>,RgbArg<RETRACTION_COLOR_ARG,Rgb<255,0,0>>,TrFade<1000>>,EFFECT_RETRACTION>,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<TrConcat<TrInstant,AlphaL<RgbArg<CLASH_COLOR_ARG,Rgb<255,255,255>>,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,19451>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,19451>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,19451>,Int<-10000>>>,Scale<ClashImpactF<>,Int<12000>,Int<60000>>>>,TrFadeX<Scale<ClashImpactF<>,Int<200>,Int<400>>>>,EFFECT_CLASH>,LockupTrL<AlphaMixL<Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,19451>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,19451>,Int<10000>>>,Scale<SwingSpeed<100>,Int<14000>,Int<18000>>>>,AudioFlickerL<RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>>,BrownNoiseFlickerL<RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>,Int<200>>>,TrConcat<TrInstant,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>,TrFade<400>>,TrConcat<TrInstant,AlphaL<RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,19451>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,19451>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,19451>,Int<-10000>>>,Int<13000>>>,TrFade<400>>,SaberBase::LOCKUP_NORMAL>,ResponsiveLightningBlockL<Strobe<RgbArg<LB_COLOR_ARG,Rgb<255,255,255>>,AudioFlicker<RgbArg<LB_COLOR_ARG,Rgb<255,255,255>>,Blue>,50,1>,TrConcat<TrInstant,AlphaL<RgbArg<LB_COLOR_ARG,Rgb<255,255,255>>,Bump<Int<12000>,Int<18000>>>,TrFade<200>>,TrConcat<TrInstant,HumpFlickerL<AlphaL<RgbArg<LB_COLOR_ARG,Rgb<255,255,255>>,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<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>>>,TrConcat<TrWipeIn<100>,AlphaL<RgbArg<STAB_COLOR_ARG,Rgb<255,24,0>>,SmoothStep<IntArg<MELT_SIZE_ARG,28000>,Int<4000>>>,TrFade<300>>,TrWipe<200>,SaberBase::LOCKUP_MELT>,InOutTrL<TrWipeX<IgnitionTime<300>>,TrWipeInX<RetractionTime<0>>,Black>>>(),
  73. },
  74.  
  75. {
  76. "Crimson_Lord", "tracks/fates.wav",
  77. //Main Blade
  78.  
  79. /* copyright Fett263 Simple (Primary Blade) OS6 Style
  80. https://fett263.com/fett263-proffieOS6-style-library.html#Simple
  81. OS6.7 v4.01
  82. Single Style
  83. Base Style: HumpFlicker Small (Single Color (50%))
  84.  
  85. Base Color: Rgb<255,0,0> (0)
  86.  
  87. --Effects Included--
  88. Ignition Effect: Standard Ignition
  89. Retraction Effect: Standard Retraction
  90. CoolDown Effect: Power Flash
  91. Lockup Effect: Responsive Lockup, Begin Effect: Real Clash, End Effect: Localized Absorb
  92. LightningBlock Effect: Responsive Lightning Block
  93. Drag Effect: Intensity Sparking Drag
  94. Melt Effect: Responsive Melt
  95. Stab Effect: AudioFlicker Stab
  96. Clash Effect: Responsive Clash
  97. */
  98. StylePtr<Layers<HumpFlicker<RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>,Mix<Int<16448>,Black,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>>,60>,TransitionEffectL<TrConcat<TrJoin<TrDelayX<RetractionTime<0>>,TrInstant>,RgbArg<RETRACTION_COLOR_ARG,Rgb<255,0,0>>,TrFade<1000>>,EFFECT_RETRACTION>,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<TrConcat<TrInstant,AlphaL<RgbArg<CLASH_COLOR_ARG,Rgb<255,255,255>>,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,19451>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,19451>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,19451>,Int<-10000>>>,Scale<ClashImpactF<>,Int<12000>,Int<60000>>>>,TrFadeX<Scale<ClashImpactF<>,Int<200>,Int<400>>>>,EFFECT_CLASH>,LockupTrL<AlphaMixL<Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,19451>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,19451>,Int<10000>>>,Scale<SwingSpeed<100>,Int<14000>,Int<18000>>>>,AudioFlickerL<RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>>,BrownNoiseFlickerL<RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>,Int<200>>>,TrConcat<TrInstant,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>,TrFade<400>>,TrConcat<TrInstant,AlphaL<RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,19451>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,19451>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,19451>,Int<-10000>>>,Int<13000>>>,TrFade<400>>,SaberBase::LOCKUP_NORMAL>,ResponsiveLightningBlockL<Strobe<RgbArg<LB_COLOR_ARG,Rgb<255,255,255>>,AudioFlicker<RgbArg<LB_COLOR_ARG,Rgb<255,255,255>>,Blue>,50,1>,TrConcat<TrInstant,AlphaL<RgbArg<LB_COLOR_ARG,Rgb<255,255,255>>,Bump<Int<12000>,Int<18000>>>,TrFade<200>>,TrConcat<TrInstant,HumpFlickerL<AlphaL<RgbArg<LB_COLOR_ARG,Rgb<255,255,255>>,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<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>>>,TrConcat<TrWipeIn<100>,AlphaL<RgbArg<STAB_COLOR_ARG,Rgb<255,24,0>>,SmoothStep<IntArg<MELT_SIZE_ARG,28000>,Int<4000>>>,TrFade<300>>,TrWipe<200>,SaberBase::LOCKUP_MELT>,InOutTrL<TrWipeX<IgnitionTime<300>>,TrWipeInX<RetractionTime<0>>,Black>>>(),
  99. },
  100.  
  101.  
  102. };
  103.  
  104. BladeConfig blades[] =
  105. {
  106. {
  107. // blade ID resistor not used
  108. 0,
  109. // Main blade, uses data1 and LED 1,2,3 pads
  110. // MAIN BLADE – 269 = the number of LEDs on the NPXL connector (16) plus the number of LEDs in the blade (253):
  111. WS2811BladePtr<269, WS2811_800kHz|WS2811_GRB>(),
  112. CONFIGARRAY(presets)
  113. }
  114. };
  115.  
  116. #endif
  117.  
  118. #ifdef CONFIG_BUTTONS
  119. Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
  120. Button AuxButton(BUTTON_AUX, auxPin, "aux");
  121. #endif
  122.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement