Advertisement
NoSloppy

Untitled

Oct 5th, 2021
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.64 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 ENABLE_SSD1306 //OLED
  19. #define SHARED_POWER_PINS
  20. #define SAVE_STATE
  21. // #define SAVE_VOLUME
  22. // #define SAVE_PRESET
  23. // #define SAVE_COLOR_CHANGE
  24. // #define SAVE_DYNAMIC_DIMMING
  25. // #define KEEP_SAVEFILES_WHEN_PROGRAMMING // upload overwrites presets.ini/tmp unless this is defined
  26. #define BLADE_DETECT_PIN blade4Pin
  27. // #define ENABLE_POWER_FOR_ID PowerPINS<bladePowerPin2, bladePowerPin3>
  28. // #define BLADE_ID_CLASS ExternalPullupBladeID<bladeIdentifyPin, 33000>
  29. #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
  30. // #define SPEAK_BLADE_ID
  31. // #define ENABLE_I2S_OUT
  32. // #define ENABLE_SPDIF_OUT
  33. // #define LINE_OUT_VOLUME 2000 // SPDIF out
  34. #define ENABLE_DEVELOPER_COMMANDS
  35. //#define DISABLE_DIAGNOSTIC_COMMANDS
  36. #define IDLE_OFF_TIME 60 * 5 * 1000
  37. #define MOTION_TIMEOUT 60 * 5 * 1000
  38. // #define ORIENTATION ORIENTATION_FETS_TOWARDS_BLADE
  39. // #define ORIENTATION ORIENTATION_USB_TOWARDS_BLADE
  40. // #define ORIENTATION ORIENTATION_TOP_TOWARDS_BLADE
  41. // #define ORIENTATION ORIENTATION_BOTTOM_TOWARDS_BLADE
  42. // #define ORIENTATION ORIENTATION_SDA_TOWARDS_BLADE
  43. // #define ORIENTATION ORIENTATION_SERIAL_TOWARDS_BLADE
  44. // #define ORIENTATION_ROTATION 0,-20,0
  45. //changes the angle required to register twists on curved hilts
  46. //example is for assaj ventress curved hit install
  47. // #define CONFIG_STARTUP_DELAY 15000 // BC now canon
  48. // #define OLED_FLIP_180 // BC now canon
  49. // #define USE_AUREBESH_FONT // BC now canon
  50. #define FEMALE_TALKIE_VOICE // BC now canon
  51. #define VOLUME_MENU_CYCLE // BC now canon
  52. #define NO_REPEAT_RANDOM // BC now canon
  53.  
  54. // ------- Gesture stuff -------
  55.  
  56. // #define BC_SWING_ON // Motion time out causing false ignitions on preset switch. This is annoying but possibly resolved with I2C updates.
  57. // #define BC_STAB_ON
  58. #define BC_THRUST_ON
  59. #define BC_TWIST_ON
  60. #define BC_TWIST_OFF
  61. // #define BC_FORCE_PUSH
  62. // #define BC_FORCE_PUSH_LENGTH 5
  63. #define ENABLE_SPINS
  64. // #define GESTURE_AUTO_BATTLE_MODE
  65. #define BC_LOCKUP_DELAY 200
  66.  
  67. // ------- Custom / Experimental / Alpha-Beta stuff ---------
  68. #define ENABLE_AUTO_SWING_BLAST // BC Multiblast continues as long as swinging within 1 second.
  69. #define LOW_BATT_WARNINGS_TIERED
  70. #define DISABLE_BASIC_PARSER_STYLES // Standard, Advanced, etc...
  71. #define USE_WAVS_FOR_TALKIE // BC Personal only because delay() is not great
  72. #define PREONS_MATCH_BLADE_EFFECTS
  73. #define PREONS_MATCH_OUTS
  74. #define PSTOFFS_MATCH_INS
  75. #define NO_BLADE_NO_GEST_ONOFF // If using blade detect, No Blade = No Gesture ignitions or retractions
  76. #define AUTO_HUMSTART // 200ms delay from on.wav beginning all the time. **Requires modified hybrid_font.h file.
  77. #define ENABLE_AUTO_SPINS_BLAST // Same as auto-multi-blast but for spins. 2 second window. **Required modified prop_base.h
  78. // #define LOW_BATT_ONCE // **Requires modified hybrid_font.h file.
  79. // #define FILTER_CUTOFF_FREQUENCY 100
  80. // #define FILTER_ORDER 8
  81. // #define ENABLE_GESTURE_MENU // PSISTORM prop - cool stuff! the TrySound else beep void.
  82.  
  83. #define ENABLE_ALL_EDIT_OPTIONS // Fett263 OS 6
  84. // #define DYNAMIC_BLADE_LENGTH
  85. // #define DYNAMIC_BLADE_DIMMING
  86. // #define DYNAMIC_CLASH_THRESHOLD
  87. // #define SAVE_VOLUME
  88. // #define SAVE_BLADE_DIMMING
  89. // #define SAVE_CLASH_THRESHOLD
  90. // #define SAVE_COLOR_CHANGE
  91.  
  92. #endif
  93.  
  94. #ifdef CONFIG_PROP
  95. #include "../props/saber_BC_buttons_personal.h" // Lately, preferring #define NUM_BUTTONS 1
  96. #endif
  97. // #ifdef CONFIG_PROP
  98. // #include "../props/saber_fett263_buttons.h"
  99. // #endif
  100.  
  101. #ifdef CONFIG_PRESETS
  102. #include "aliases/TrueWhites/BC_effects_1.h"
  103. #include "aliases/TrueWhites/BC_effects_2.h"
  104. #include "aliases/TrueWhites/BC_effects_Red.h"
  105. #include "aliases/TrueWhites/BC_effects_White.h"
  106.  
  107.  
  108. Preset CTAbladein [] = {
  109.  
  110. { "a_DARKSABER/DarkV3;common", "a_DARKSABER/DarkV3/tracks/Mandalorian.wav",
  111. StylePtr<Layers<
  112. Mix<SwingSpeed<400>,RotateColorsX<Variation,Rgb<80,100,150>>,RotateColorsX<Variation,Rgb<130,150,225>>>,
  113. 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>>,
  114. AudioFlickerL<RotateColorsX<Variation,Rgb<25,35,75>>>,
  115. AlphaL<RotateColorsX<Variation,Rgb<155,175,225>>,SwingSpeed<600>>,
  116. BC_effects_1,
  117. InOutTrL<TrWipe<300>,TrWipeInX<WavLen<EFFECT_RETRACTION>>>,
  118. // On-Demand Battery Level
  119. 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>>>
  120. >>(),
  121. // HiltPCB
  122. StylePtr<Black>(),
  123. // Switches
  124. StylePtr<Layers<
  125. Pulsing<RotateColorsX<Variation,Rgb<100,100,150>>,Black,200>,
  126. //InOutTrL<TrInstant,TrInstant,Pulsing<RotateColorsX<Variation,Rgb<100,100,150>>,Black,2500>>>>(),
  127. InOutTrL<TrInstant,TrInstant,ColorSequence<500,Red,Green,Blue,Black>>>>(),
  128. // Pommel
  129. StylePtr<Layers<
  130. Pulsing<Blue,Black,200>,
  131. InOutTrL<TrInstant,TrInstant,Pulsing<Blue,Black,2500>>>>(),
  132. // Bluetooth
  133. StylePtr<Blue>(),
  134. " dark\n v3"},
  135.  
  136.  
  137. { "testfont2a", "testfont2a/tracks/track3.wav",
  138.  
  139. StylePtr<Layers<
  140. AudioFlicker<RotateColorsX<Variation,Rgb<0,149,255>>,RotateColorsX<Variation,Rgb<0,85,200>>>,
  141. BC_effects_1,
  142. InOutTrL<
  143. TrConcat<TrInstant,Layers<
  144. TransitionEffectL<TrConcat<TrInstant,Black,TrDelay<1950>>,EFFECT_IGNITION>,
  145. AlphaL<AudioFlicker<RotateColorsX<Variation,Rgb<0,149,255>>,RotateColorsX<Variation,Rgb<0,85,200>>>,
  146. SmoothStep<Scale<Trigger<EFFECT_IGNITION,Scale<Trigger<EFFECT_IGNITION,Int<2000>,Int<1>,Int<1>>,Int<300>,Int<2000>>,Int<1>,Int<1>>,Int<-1200>,Int<35000>>,Int<-3000>>>>,TrDelay<5000>>,
  147. TrConcat<TrInstant,Layers<
  148. TransitionEffectL<TrConcat<TrInstant,Black,TrDelay<2000>>,EFFECT_RETRACTION>,
  149. AlphaL<AudioFlicker<RotateColorsX<Variation,Rgb<0,149,255>>,RotateColorsX<Variation,Rgb<0,85,200>>>,
  150. SmoothStep<Scale<Trigger<EFFECT_RETRACTION,Scale<Trigger<EFFECT_RETRACTION,Int<1000>,Int<1000>,Int<1>>,Int<3000>,Int<10>>,Int<1000>,Int<500>>,Int<35000>,Int<-1200>>,Int<-3000>>>>,TrDelay<1000>>>,
  151. // TransitionEffectL<TrConcat<TrFade<500>,SparkleL<Blue,200,100>,TrDelayX<WavLen<EFFECT_PREON>>>,EFFECT_PREON>,
  152. // TransitionEffectL<TrConcat<TrFade<500>,Red,TrDelayX<WavLen<EFFECT_PREON>>>,EFFECT_PREON1>,
  153. // TransitionEffectL<TrConcat<TrFade<500>,Green,TrDelayX<WavLen<EFFECT_PREON>>>,EFFECT_PREON2>,
  154. // TransitionEffectL<TrConcat<TrFade<500>,Blue,TrDelayX<WavLen<EFFECT_PREON>>>,EFFECT_PREON3>,
  155. //TransitionEffectL<TrConcat<TrInstant,SparkleL<Blue,200,100>,TrFadeX<WavLen<EFFECT_RETRACTION>>>,EFFECT_RETRACTION>,
  156. 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>>>
  157. >>(),
  158.  
  159. // HiltPCB
  160. StylePtr<Black>(),
  161. // Switches
  162. StylePtr<Layers<
  163. Pulsing<RotateColorsX<Variation,Rgb<100,100,150>>,Black,200>,
  164. InOutTrL<TrInstant,TrInstant,Pulsing<RotateColorsX<Variation,Rgb<100,100,150>>,Black,2500>>>>(),
  165. // Pommel
  166. StylePtr<Layers<
  167. Pulsing<Blue,Black,200>,
  168. InOutTrL<TrInstant,TrInstant,Pulsing<Blue,Black,2500>>>>(),
  169. // Bluetooth
  170. StylePtr<Blue>(),
  171. "accel-in-out\ntest1"},
  172.  
  173.  
  174. { "Wavlen", "",
  175. StylePtr<Layers<
  176. Red,
  177. TransitionEffectL<TrConcat< TrFadeX< Percentage<WavLen<>,33> >, StyleFire<Blue,Cyan>, TrInstant, Cyan, TrDelayX< Percentage<WavLen<>,33> >, Green, TrWipeX< Percentage<WavLen<>,33> > >,EFFECT_FORCE>,
  178.  
  179. InOutTrL<TrWipe<300>,TrWipeInX<WavLen<EFFECT_RETRACTION>>>,
  180. TransitionEffectL<TrConcat<TrInstant,Layers<White,AlphaL<Black,SmoothStep<Trigger<EFFECT_PREON,Int<700>,Int<10>,Int<1>>,Int<1>>>>,TrDelayX<Int<700>>>,EFFECT_PREON>
  181. >>(),
  182.  
  183. // HiltPCB
  184. StylePtr<Black>(),
  185. // Switches
  186. StylePtr<Layers<
  187. Pulsing<RotateColorsX<Variation,Rgb<100,100,150>>,Black,200>,
  188. InOutTrL<TrInstant,TrInstant,Pulsing<RotateColorsX<Variation,Rgb<100,100,150>>,Black,2500>>>>(),
  189. // Pommel
  190. StylePtr<Layers<
  191. Pulsing<Blue,Black,200>,
  192. InOutTrL<TrInstant,TrInstant,Pulsing<Blue,Black,2500>>>>(),
  193. // Bluetooth
  194. StylePtr<Blue>(),
  195. "wavlen\ntest11"},
  196.  
  197.  
  198. { "a_BANE/RuleOfTwo;common", "a_BANE/tracks/track3.wav", // Testing IceForce monosfx
  199.  
  200. StylePtr<Layers<
  201. AudioFlicker<BrownNoiseFlicker<RotateColorsX<Variation,Red>,RotateColorsX<Variation,Rgb<60,0,0>>,500>,RotateColorsX<Variation,Rgb<128,0,0>>>,
  202. TransitionEffectL<TrConcat<TrFade<7000>,Rgb<0,0,75>,TrDelay<1000>>,EFFECT_USER2>,
  203. TransitionEffectL<TrConcat<TrWipe<8000>,TransitionEffect<Stripes<10000,-1000,Rgb<50,75,165>,Rgb<25,37,82>,Rgb<50,75,165>,Rgb<13,19,41>>,
  204. Sparkle<Rgb<25,105,255>,Rgb<250,250,250>,30,200>,
  205. TrFade<11500>,TrDelay<20000>,EFFECT_USER2>,TrDelay<7000>,
  206. Sparkle<Rgb<25,105,255>,Rgb<250,250,250>,30,200>,
  207. TrJoin<TrWipe<7000>,TrSmoothFade<9500>>>,EFFECT_USER2>,
  208. TransitionEffectL<TrConcat<TrJoin<TrWaveX<BrownNoiseFlicker<Rgb<100,200,255>,DeepSkyBlue,60>,Int<400>,Int<50>,Int<1000>,Int<0>>,TrWaveX<BrownNoiseFlicker<Rgb<100,200,255>,SteelBlue,600>,Int<15000>,Int<400>,Int<8000>,Int<0>>,TrWaveX<Sparkle<AlphaL<Rgb<100,200,255>,Int<0>>,Rgb<100,200,255>,3000,200>,Int<15000>,Int<100>,Int<8000>,Int<-7000>>>,AlphaL<Rgb<100,200,255>,Int<0>>,TrJoin<TrWaveX<BrownNoiseFlicker<Rgb<100,200,255>,DeepSkyBlue,300>,Int<300>,Int<50>,Int<1000>,Int<0>>,TrWaveX<Sparkle<AlphaL<Rgb<100,200,255>,Int<0>>,Rgb<100,200,255>,3000,200>,Int<40000>,Int<300>,Int<7000>,Int<3000>>,TrWaveX<BrownNoiseFlicker<DarkOrange,Yellow,80>,Int<15000>,Int<400>,Int<7000>,Int<0>>>>,EFFECT_USER2>,
  209. BC_effects_Red,
  210. InOutTrL<
  211. TrConcat<TrInstant,Layers<
  212. TransitionEffectL<TrConcat<TrInstant,Black,TrDelay<1950>>,EFFECT_IGNITION>,
  213. AlphaL<AudioFlicker<BrownNoiseFlicker<RotateColorsX<Variation,Red>,RotateColorsX<Variation,Rgb<60,0,0>>,500>,RotateColorsX<Variation,Rgb<128,0,0>>>,
  214. SmoothStep<Scale<Trigger<EFFECT_IGNITION,Scale<Trigger<EFFECT_IGNITION,Int<2000>,Int<1>,Int<1>>,Int<300>,Int<2000>>,Int<1>,Int<1>>,Int<-1200>,Int<35000>>,Int<-3000>>>>,TrDelay<5000>>,
  215. TrConcat<TrInstant,Layers<
  216. TransitionEffectL<TrConcat<TrInstant,Black,TrDelay<2000>>,EFFECT_RETRACTION>,
  217. AlphaL<AudioFlicker<BrownNoiseFlicker<RotateColorsX<Variation,Red>,RotateColorsX<Variation,Rgb<60,0,0>>,500>,RotateColorsX<Variation,Rgb<128,0,0>>>,
  218. SmoothStep<Scale<Trigger<EFFECT_RETRACTION,Scale<Trigger<EFFECT_RETRACTION,Int<1000>,Int<1000>,Int<1>>,Int<3000>,Int<10>>,Int<1000>,Int<500>>,Int<35000>,Int<-1200>>,Int<-3000>>>>,TrDelay<1000>>>,
  219. TransitionEffectL<TrConcat<TrWipe<100>,AlphaL<HumpFlickerL<RotateColorsX<Variation,Rgb<60,0,0>>,90>,SmoothStep<Int<2000>,Int<-500>>>,
  220. TrDelayX< Percentage<WavLen<EFFECT_PREON>,49> >,AlphaL<HumpFlickerL<RotateColorsX<Variation,Rgb<60,0,0>>,90>,SmoothStep<Int<2000>,Int<-500>>>,
  221. TrFadeX< Percentage<WavLen<EFFECT_PREON>,49> >,AlphaL<HumpFlickerL<RotateColorsX<Variation,BrownNoiseFlicker<Yellow,OrangeRed,50>>,90>,SmoothStep<Int<2700>,Int<-500>>>,TrInstant>,EFFECT_PREON>,
  222. // On-Demand Battery Level
  223. 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>>>
  224. >>(),
  225. // HiltPCB
  226. StylePtr<Black>(),
  227. // Switches
  228. StylePtr<Layers<
  229. // Sith Crystal Red
  230. Stripes<1000,-2000,RotateColorsX<Variation,Red>,RotateColorsX<Variation,Rgb<90,0,0>>,Black>,
  231. // Sith Force Red
  232. TransitionEffectL<TrConcat<TrFade<600>,RandomFlicker<RotateColorsX<Variation,Red>,RotateColorsX<Variation,Rgb<160,0,0>>>,TrDelay<3000>,RotateColorsX<Variation,Red>,TrFade<800>>,EFFECT_FORCE>,
  233. BC_effects_2,
  234. InOutTrL<TrConcat<TrInstant,White,TrSmoothFade<1000>>,TrConcat<TrSmoothFade<500>,White,TrSmoothFade<500>>,Mix<IsLessThan<SlowNoise<Int<3000>>,Int<6000>>,Pulsing<ColorCycle<RotateColorsX<Variation,Red>,25,20,Black,100,300,1000>,Black,2000>,Black>>
  235. >>(),
  236. // Pommel
  237. StylePtr<Layers<
  238. Pulsing<Blue,Black,200>,
  239. InOutTrL<TrInstant,TrInstant,Pulsing<Blue,Black,2500>>>>(),
  240. // Bluetooth
  241. StylePtr<Blue>(),
  242. "rule of\ntwo"},
  243.  
  244. };
  245.  
  246. //----------------------------------------------------------------------------------------------------------------------------------------
  247. Preset noblade[] = {
  248.  
  249. // preset 0
  250. { "a_DARKSABER/DarkV3;common", "",
  251. // Main Blade
  252. StylePtr<Black>(),
  253. // HiltPCB
  254. StylePtr<Layers<
  255. Mix<SwingSpeed<400>,RotateColorsX<Variation,Rgb<100,100,150>>,RotateColorsX<Variation,Rgb<150,150,225>>>,
  256. 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>>,
  257. AudioFlickerL<RotateColorsX<Variation,Rgb<35,35,75>>>,
  258. AlphaL<RotateColorsX<Variation,Rgb<175,175,225>>,SwingSpeed<600>>,
  259. BC_effects_1,
  260. InOutTrL<TrWipe<300>,TrWipeIn<500>>,
  261. // On-Demand Battery Level
  262. 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>>>
  263. >>(),
  264. // Switches
  265. StylePtr<Layers<
  266. Pulsing<RotateColorsX<Variation,Rgb<100,100,150>>,Black,200>,
  267. InOutTrL<TrInstant,TrInstant,Pulsing<RotateColorsX<Variation,Rgb<100,100,150>>,Black,2500>>>>(),
  268. // Pommel
  269. StylePtr<Layers<
  270. Pulsing<Blue,Black,200>,
  271. InOutTrL<TrInstant,TrInstant,Pulsing<Blue,Black,2500>>>>(),
  272. // Bluetooth
  273. StylePtr<Blue>(),
  274. " dark\n v3"},
  275.  
  276. // preset 1
  277. { "testfont2a", "testfont2a/tracks/track1.wav",
  278. // Main Blade
  279. StylePtr<LengthFinder<>>(),
  280. // Hilt PCB
  281. StylePtr<Layers<
  282. Pulsing<Blue,Black,200>,
  283. InOutTrL<TrInstant,TrInstant,Pulsing<Blue,Black,2500>>>>(),
  284. // Switches
  285. StylePtr<Black>(),
  286. // Pommel
  287. StylePtr<Layers<
  288. Pulsing<Blue,Black,200>,
  289. InOutTrL<TrInstant,TrInstant,Pulsing<Blue,Black,2500>>>>(),
  290. // Bluetooth
  291. StylePtr<Blue>(),
  292. "testfont2a-preon/out-pstoff/in matching"},
  293.  
  294.  
  295. };
  296.  
  297. struct AccentsLED {
  298. static constexpr float MaxAmps = 0.02;
  299. static constexpr float MaxVolts = 3.2;
  300. static constexpr float P2Amps = 0.10;
  301. static constexpr float P2Volts = 3.0;
  302. static constexpr float R = 0; // Resistor value
  303. static const int Red = 0;
  304. static const int Green = 0;
  305. static const int Blue = 255;
  306. };
  307.  
  308. BladeConfig blades[] = {
  309. { 123, // BCA 123, 1" Ciel_Tan_A 132 D1_data_line = proffie_D1---> NPXL ctrpin---> bladePCB 330ohm--->Main blade strips
  310. WS281XBladePtr<132, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(), // Main Blade
  311. WS281XBladePtr<5, blade2Pin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(), // HiltPCB
  312. WS281XBladePtr<11, blade3Pin, Color8::GRB, PowerPINS<bladePowerPin5> >(), // Switches
  313. SimpleBladePtr<AccentsLED, NoLED, NoLED, NoLED, bladePowerPin1, -1, -1, -1>(), // Pommel
  314. SimpleBladePtr<CH3LED, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(), // Bluetooth
  315. CONFIGARRAY(CTAbladein),
  316. "01_bladein_save"},
  317.  
  318. { NO_BLADE, // D1_data_line = proffie_D1---> NPXL ctrpin---> bladePCB 330ohm--->Main blade strips
  319. WS281XBladePtr<132, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(), // Main Blade
  320. WS281XBladePtr<5, blade2Pin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(), // HiltPCB
  321. WS281XBladePtr<11, blade3Pin, Color8::GRB, PowerPINS<bladePowerPin5> >(), // Switches
  322. SimpleBladePtr<AccentsLED, NoLED, NoLED, NoLED, bladePowerPin1, -1, -1, -1>(), // Pommel
  323. SimpleBladePtr<CH3LED, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(), // Bluetooth
  324. CONFIGARRAY(noblade),
  325. "00_NO_BLADE_save"},
  326.  
  327.  
  328. };
  329. #endif
  330.  
  331. #ifdef CONFIG_BUTTONS
  332. Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
  333. Button AuxButton(BUTTON_AUX, auxPin, "aux");
  334. #endif
  335.  
  336. // // Button connect to 3.3v instead of GND. Up to 5v is OK
  337. // PullDownButton PowerButton(BUTTON_POWER, powerButtonPin, "pow"); // isn't this backwards?
  338.  
  339. // // Analog Potentiometer
  340. // ChangeVolumeAnalogReceiver volume_function;
  341. // PotClass pot(0, &volume_function);
  342.  
  343. // // Or, you can use it to change the variation (color):
  344.  
  345. // ChangeVariationAnalogReceiver variation_function;
  346. // PotClass pot(0, &variation_function);
  347.  
  348. // // Rotary Encoder
  349.  
  350. // ChangePresetRotaryReceiver rotary_receiver;
  351. // Rotary<8, 9> rotary(&rotary_receiver);
  352. /*
  353. The receiver decides what the rotary events do.
  354. There are currently receivers for changing presets,
  355. changing variation and one that just prints things out.
  356. More receivers can be added as needed.
  357. (I should probably create one for changing the volume.)
  358. */
  359.  
  360. // Support for 128x64 OLED
  361. // #ifdef CONFIG_BOTTOM
  362. // SSD1306Template<128, uint64_t> display(0x3C);
  363. // #endif
  364.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement