Advertisement
NoSloppy

Untitled

Oct 5th, 2021
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.65 KB | None | 0 0
  1. //BC_DarkShadow_6.x// ProffieOS version 6.x - BC manual update - Native WavLen!
  2.  
  3. // Use 1 button config?
  4.  
  5. #ifdef CONFIG_TOP
  6. #include "proffieboard_v3_config.h"
  7. #define NUM_BLADES 5
  8. #define NUM_BUTTONS 1
  9. #define VOLUME 500
  10. const unsigned int maxLedsPerStrip = 144;
  11. #define EXTRA_COLOR_BUFFER_SPACE 30 // New define that can speed up processing a bit. Basically, it can calculate the colors for the next blade (or the next frame for the same blade) even though it's not done feeding out the data for the data in the color buffer yet.
  12. #define CLASH_THRESHOLD_G 3.5
  13. #define ENABLE_AUDIO
  14. #define ENABLE_MOTION
  15. #define ENABLE_WS2811
  16. #define ENABLE_SD
  17. #define ENABLE_SERIAL // Bluetooth
  18. #define SHARED_POWER_PINS
  19. #define SAVE_STATE
  20. #define BLADE_DETECT_PIN blade4Pin
  21. #define BLADE_ID_CLASS SnapshotBladeID<bladeIdentifyPin> // This will make it use the speed-of-charging-a-capacitor method of blade ID which sometimes works without resistors
  22. #define ENABLE_DEVELOPER_COMMANDS
  23. #define IDLE_OFF_TIME 60 * 5 * 1000
  24. #define MOTION_TIMEOUT 60 * 5 * 1000
  25. #define FEMALE_TALKIE_VOICE // BC now canon
  26. #define VOLUME_MENU_CYCLE // BC now canon
  27. #define NO_REPEAT_RANDOM // BC now canon
  28.  
  29. // ------- Gesture stuff -------
  30.  
  31. // #define BC_SWING_ON // Motion time out causing false ignitions on preset switch. This is annoying but possibly resolved with I2C updates.
  32. // #define BC_STAB_ON
  33. #define BC_THRUST_ON
  34. #define BC_TWIST_ON
  35. #define BC_TWIST_OFF
  36. // #define BC_FORCE_PUSH
  37. // #define BC_FORCE_PUSH_LENGTH 5
  38. #define ENABLE_SPINS
  39. // #define GESTURE_AUTO_BATTLE_MODE
  40. #define BC_LOCKUP_DELAY 200
  41. #define ENABLE_ALL_EDIT_OPTIONS // Fett263 OS 6
  42. // #define DYNAMIC_BLADE_LENGTH
  43. // #define DYNAMIC_BLADE_DIMMING
  44. // #define DYNAMIC_CLASH_THRESHOLD
  45. // #define SAVE_VOLUME
  46. // #define SAVE_BLADE_DIMMING
  47. // #define SAVE_CLASH_THRESHOLD
  48. // #define SAVE_COLOR_CHANGE
  49.  
  50. #endif
  51.  
  52. #ifdef CONFIG_PRESETS
  53.  
  54. Preset CTAbladein [] = {
  55.  
  56. { "a_DARKSABER/DarkV3;common", "a_DARKSABER/DarkV3/tracks/Mandalorian.wav",
  57. StylePtr<Layers<
  58. Mix<SwingSpeed<400>,RotateColorsX<Variation,Rgb<80,100,150>>,RotateColorsX<Variation,Rgb<130,150,225>>>,
  59. BrownNoiseFlickerL<Stripes<5000,-300,RotateColorsX<Variation,Rgb<15,25,55>>,RotateColorsX<Variation,Rgb<60,75,120>>,RotateColorsX<Variation,Rgb<0,10,20>>,RotateColorsX<Variation,Rgb<40,50,75>>>,Int<38400>>,
  60. AudioFlickerL<RotateColorsX<Variation,Rgb<25,35,75>>>,
  61. AlphaL<RotateColorsX<Variation,Rgb<155,175,225>>,SwingSpeed<600>>,
  62. InOutTrL<TrWipe<300>,TrWipeInX<WavLen<EFFECT_RETRACTION>>>,
  63. // On-Demand Battery Level
  64. 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<BatteryLevel,Int<-1>>>,TrSmoothFade<1000>>,EFFECT_BATTERY_LEVEL>,Ifon<Int<0>,Int<32768>>>
  65. >>(),
  66. // HiltPCB
  67. StylePtr<Black>(),
  68. // Switches
  69. StylePtr<Layers<
  70. Pulsing<RotateColorsX<Variation,Rgb<100,100,150>>,Black,200>,
  71. //InOutTrL<TrInstant,TrInstant,Pulsing<RotateColorsX<Variation,Rgb<100,100,150>>,Black,2500>>>>(),
  72. InOutTrL<TrInstant,TrInstant,ColorSequence<500,Red,Green,Blue,Black>>>>(),
  73. // Pommel
  74. StylePtr<Layers<
  75. Pulsing<Blue,Black,200>,
  76. InOutTrL<TrInstant,TrInstant,Pulsing<Blue,Black,2500>>>>(),
  77. // Bluetooth
  78. StylePtr<Blue>(),
  79. " dark\n v3"},
  80.  
  81.  
  82. };
  83.  
  84. //----------------------------------------------------------------------------------------------------------------------------------------
  85. Preset noblade[] = {
  86.  
  87. // preset 0
  88. { "a_DARKSABER/DarkV3;common", "",
  89. // Main Blade
  90. StylePtr<Black>(),
  91. // HiltPCB
  92. StylePtr<Layers<
  93. Mix<SwingSpeed<400>,RotateColorsX<Variation,Rgb<100,100,150>>,RotateColorsX<Variation,Rgb<150,150,225>>>,
  94. BrownNoiseFlickerL<Stripes<5000,-300,RotateColorsX<Variation,Rgb<25,25,55>>,RotateColorsX<Variation,Rgb<75,75,120>>,RotateColorsX<Variation,Rgb<10,10,20>>,RotateColorsX<Variation,Rgb<50,50,75>>>,Int<38400>>,
  95. AudioFlickerL<RotateColorsX<Variation,Rgb<35,35,75>>>,
  96. AlphaL<RotateColorsX<Variation,Rgb<175,175,225>>,SwingSpeed<600>>,
  97. InOutTrL<TrWipe<300>,TrWipeIn<500>>,
  98. // On-Demand Battery Level
  99. 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<BatteryLevel,Int<-1>>>,TrSmoothFade<1000>>,EFFECT_BATTERY_LEVEL>,Ifon<Int<0>,Int<32768>>>
  100. >>(),
  101. // Switches
  102. StylePtr<Layers<
  103. Pulsing<RotateColorsX<Variation,Rgb<100,100,150>>,Black,200>,
  104. InOutTrL<TrInstant,TrInstant,Pulsing<RotateColorsX<Variation,Rgb<100,100,150>>,Black,2500>>>>(),
  105. // Pommel
  106. StylePtr<Layers<
  107. Pulsing<Blue,Black,200>,
  108. InOutTrL<TrInstant,TrInstant,Pulsing<Blue,Black,2500>>>>(),
  109. // Bluetooth
  110. StylePtr<Blue>(),
  111. " dark\n v3"},
  112.  
  113. // preset 1
  114. { "testfont2a", "testfont2a/tracks/track1.wav",
  115. // Main Blade
  116. StylePtr<LengthFinder<>>(),
  117. // Hilt PCB
  118. StylePtr<Layers<
  119. Pulsing<Blue,Black,200>,
  120. InOutTrL<TrInstant,TrInstant,Pulsing<Blue,Black,2500>>>>(),
  121. // Switches
  122. StylePtr<Black>(),
  123. // Pommel
  124. StylePtr<Layers<
  125. Pulsing<Blue,Black,200>,
  126. InOutTrL<TrInstant,TrInstant,Pulsing<Blue,Black,2500>>>>(),
  127. // Bluetooth
  128. StylePtr<Blue>(),
  129. "testfont2a-preon/out-pstoff/in matching"},
  130.  
  131.  
  132. };
  133.  
  134. struct AccentsLED {
  135. static constexpr float MaxAmps = 0.02;
  136. static constexpr float MaxVolts = 3.2;
  137. static constexpr float P2Amps = 0.10;
  138. static constexpr float P2Volts = 3.0;
  139. static constexpr float R = 0; // Resistor value
  140. static const int Red = 0;
  141. static const int Green = 0;
  142. static const int Blue = 255;
  143. };
  144.  
  145. BladeConfig blades[] = {
  146. { 123, // BCA 123, 1" Ciel_Tan_A 132 D1_data_line = proffie_D1---> NPXL ctrpin---> bladePCB 330ohm--->Main blade strips
  147. WS281XBladePtr<132, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(), // Main Blade
  148. WS281XBladePtr<5, blade2Pin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(), // HiltPCB
  149. WS281XBladePtr<11, blade3Pin, Color8::GRB, PowerPINS<bladePowerPin5> >(), // Switches
  150. SimpleBladePtr<AccentsLED, NoLED, NoLED, NoLED, bladePowerPin1, -1, -1, -1>(), // Pommel
  151. SimpleBladePtr<CH3LED, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(), // Bluetooth
  152. CONFIGARRAY(CTAbladein),
  153. "01_bladein_save"},
  154.  
  155. { NO_BLADE, // D1_data_line = proffie_D1---> NPXL ctrpin---> bladePCB 330ohm--->Main blade strips
  156. WS281XBladePtr<132, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(), // Main Blade
  157. WS281XBladePtr<5, blade2Pin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(), // HiltPCB
  158. WS281XBladePtr<11, blade3Pin, Color8::GRB, PowerPINS<bladePowerPin5> >(), // Switches
  159. SimpleBladePtr<AccentsLED, NoLED, NoLED, NoLED, bladePowerPin1, -1, -1, -1>(), // Pommel
  160. SimpleBladePtr<CH3LED, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(), // Bluetooth
  161. CONFIGARRAY(noblade),
  162. "00_NO_BLADE_save"},
  163.  
  164.  
  165. };
  166. #endif
  167.  
  168. #ifdef CONFIG_BUTTONS
  169. Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
  170. Button AuxButton(BUTTON_AUX, auxPin, "aux");
  171. #endif
  172.  
  173.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement