Advertisement
Sabersense

Array Merge Config

Dec 1st, 2024
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.51 KB | None | 0 0
  1.  
  2.  
  3. #ifdef CONFIG_TOP
  4. #include "proffieboard_v2_config.h"
  5. #define NUM_BLADES 2
  6. #define NUM_BUTTONS 2
  7. const unsigned int maxLedsPerStrip = 144;
  8. #define ENABLE_AUDIO
  9. #define ENABLE_MOTION
  10. #define ENABLE_WS2811
  11. #define ENABLE_SD
  12. // #define SABERSENSE_OS7_LEGACY_SUPPORT
  13. // Required when using Sabersense prop file with ProffieOS 7.x.
  14. // Must not be used with ProffieOS 8.x.
  15.  
  16. // VOLUME DEFINES
  17. #define VOLUME 1900 // Maximum volume that can be reached.
  18. #define BOOT_VOLUME 1400 // Default volume at bootup.
  19. // Over-ridden once user adjusts volume
  20. // due to SAVE_STATE.
  21.  
  22. // OPTIONAL SYSTEM DEFINES
  23. #define NO_REPEAT_RANDOM
  24. #define FEMALE_TALKIE_VOICE
  25. #define KILL_OLD_PLAYERS
  26. #define IDLE_OFF_TIME 15 * 60 * 1000
  27. // Minutes multiplied by seconds multiplied by milliseconds. (15 * 60 * 1000 = 15 minutes).
  28.  
  29. // SAVE SETTINGS - See Technical Note 1 above.
  30. #define SAVE_STATE
  31. // #define SAVE_VOLUME
  32. // #define SAVE_PRESET
  33.  
  34.  
  35. // PRIMARY CLASH CONTROL - See Technical Note 2 above for further clash controls.
  36. #define CLASH_THRESHOLD_G 3.2
  37. // Range is 0 to 16 by default.
  38.  
  39.  
  40. // OPTIONAL FEATURE DEFINES
  41. #define DYNAMIC_BLADE_LENGTH
  42. #define DYNAMIC_CLASH_THRESHOLD
  43. #define SAVE_CLASH_THRESHOLD
  44.  
  45. #define ENABLE_SERIAL // Required for Bluetooth Module.
  46.  
  47. #define FILTER_CUTOFF_FREQUENCY 160
  48. #define FILTER_ORDER 4
  49. // #define ORIENTATION ORIENTATION_USB_TOWARDS_BLADE
  50. // #define SHARED_POWER_PINS
  51.  
  52.  
  53. // BLADE ID AND BLADE DETECT
  54. // See Technical Note 1 above when using BLADE_ID or ARRAY_SELECTOR.
  55. #define ENABLE_POWER_FOR_ID PowerPINS<bladePowerPin2, bladePowerPin3> // Required for BLADE_ID but not ARRAY_SELECTOR.
  56. #define SABERSENSE_BLADE_ID // Custom BladeID setting plays arrayX.wav files
  57. // with BladeID detection.
  58. // #define SABERSENSE_ARRAY_SELECTOR // Cycles through blade/preset arrays manually, ignores BladeID status.
  59. // #define SABERSENSE_NUM_ARRAYS 4 // Insert number of blade arrays. Required when using SABERSENSE_ARRAY_SELECTOR.
  60.  
  61. // #define BLADE_DETECT_PIN 22 // See Technical Note 3 above.
  62.  
  63.  
  64. // REQUIRED FOR OLED MODULE
  65. // #define ENABLE_SSD1306
  66. // #define OLED_FLIP_180 // Optional
  67. // #define PLI_OFF_TIME 30 * 1000
  68. // Controls how long battery display is shown on OLED after animations end.
  69. // Seconds multiplied by milliseconds. (30 * 1000 = 30 seconds).
  70.  
  71.  
  72. // MEMORY SAVING OPTIONS
  73. #define DISABLE_BASIC_PARSER_STYLES // Disables default named styles found in Proffie Workbench. Saves 8k!
  74. #define DISABLE_DIAGNOSTIC_COMMANDS
  75. // #define VERBOSE_SD_ERRORS // Used for diagnostic tracing of faults.
  76.  
  77.  
  78. // CUSTOM SABERSENSE BUTTON CONTROLS
  79. // Gesture controls bypass Preon effects.
  80. #define SABERSENSE_TWIST_ON
  81. #define SABERSENSE_TWIST_OFF
  82. // #define SABERSENSE_STAB_ON
  83. // #define SABERSENSE_THRUST_ON
  84. // #define SABERSENSE_SWING_ON
  85.  
  86. // #define SABERSENSE_FLIP_AUDIO_PLAYERS // Reverses all audio Players so that QUOTE plays when pointing down.
  87. // #define SABERSENSE_SWAP_MUTE_PRESET_1B // Swaps 1-Button Next/Previous Preset and Ignite Mute controls.
  88. // #define SABERSENSE_BUTTON_CLICKER // For Scavenger hilt. Plays press/release.wav files with button pushes.
  89. // #define SABERSENSE_NO_LOCKUP_HOLD // Reverts to lockup being triggered by holding AUX while clashing.
  90. #endif
  91.  
  92.  
  93. #ifdef CONFIG_PROP
  94. #include "../props/saber_sabersense_buttons_v70.h"
  95. #endif
  96.  
  97.  
  98. // BLADE PLUG CHARGING
  99. // Use section below for blade plug charging to keep FETs powered while charging.
  100. // Use ChargingStylePtr<BlackPower>(), for charging blade style.
  101. #ifdef CONFIG_STYLES
  102. class BlackPower {
  103. public:
  104. LayerRunResult run(BladeBase* base) {
  105. return LayerRunResult::UNKNOWN;
  106. }
  107. SimpleColor getColor(int led) {
  108. return SimpleColor(Color16(0,0,0));
  109. }
  110. };
  111.  
  112. using ON = Rgb<255,255,255>; // Use StylePtr<ON>(), for Bluetooth/Motor ON.
  113. using OFF = Rgb<0,0,0>; // Use StylePtr<OFF>(), for Bluetooth/Motor OFF.
  114. #endif
  115.  
  116. // MOTOR/BLUETOOTH ON/OFF DEFINES
  117.  
  118.  
  119.  
  120. // *************************************************************************
  121. // *************************************************************************
  122. // *********************** THE BLADE STYLES ************************
  123. // *************************************************************************
  124. // *************************************************************************
  125. #ifdef CONFIG_PRESETS
  126. Preset noblade[] = {
  127.  
  128. { "PreFont0;FontPrem/ANHGrfx1;Shared/Random;Shared/Function", "tracks/ANH_Track5.wav",
  129. // Main Blade:
  130. StylePtr<Layers<Layers<ColorCycle<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,DeepSkyBlue>,Blue,Cyan,DodgerBlue,Green,Rgb<28,255,28>,Red,Magenta,Rgb<255,80,154>,Yellow,Orange,Azure>,0,1,ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,DeepSkyBlue>,Blue,Cyan,DodgerBlue,Green,Rgb<28,255,28>,Red,Magenta,Rgb<255,80,154>,Yellow,Orange,Azure>,70,1000,4000>,TransitionEffectL<TrConcat<TrWipe<1000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrDelay<2000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrWipeIn<1000>>,EFFECT_BATTERY_LEVEL>>>>("~ ~ 0"),
  131.  
  132. // Accent LED 1 Red: ("~ ~ 0"),
  133.  
  134. // Accent LED 2 Green: ("~ ~ 0"),
  135.  
  136. // Bluetooth Module:
  137. StylePtr<ON>(),
  138. "graflex"},
  139.  
  140.  
  141. // **************************
  142.  
  143.  
  144. { "PreFont0;FontPrem/ANHGrfx2;Shared/Random;Shared/Function", "tracks/ANH_Track6.wav",
  145. // Main Blade:
  146. StylePtr<Layers<Layers<ColorCycle<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,DeepSkyBlue>,Blue,Cyan,DodgerBlue,Green,Rgb<28,255,28>,Red,Magenta,Rgb<255,80,154>,Yellow,Orange,Azure>,0,1,ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,DeepSkyBlue>,Blue,Cyan,DodgerBlue,Green,Rgb<28,255,28>,Red,Magenta,Rgb<255,80,154>,Yellow,Orange,Azure>,70,1000,4000>,TransitionEffectL<TrConcat<TrWipe<1000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrDelay<2000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrWipeIn<1000>>,EFFECT_BATTERY_LEVEL>>>>("~ ~ 0"),
  147.  
  148. // Accent LED 1 Red: ("~ ~ 0"),
  149.  
  150. // Accent LED 2 Green: ("~ ~ 0"),
  151.  
  152. // Bluetooth Module:
  153. StylePtr<ON>(),
  154. "graflex"},
  155.  
  156.  
  157.  
  158. };
  159.  
  160. // *************************************************************************
  161. // *************************************************************************
  162. Preset testblde[] = {
  163.  
  164. { "PreFont1;FontPrem/ANHGrfx1;Shared/Luke;Shared/Function", "tracks/ANH_Track5.wav",
  165. // Main Blade:
  166. StylePtr<Layers<Layers<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,DeepSkyBlue>,Blue,Cyan,DodgerBlue,Green,Rgb<28,255,28>,Red,Magenta,Rgb<255,80,154>,Yellow,Orange,Azure>,RandomL<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,Rgb<0,107,205>>,Rgb<0,0,205>,Rgb<0,205,205>,Rgb<0,60,205>,Rgb<0,205,0>,Rgb<22,205,22>,Rgb<205,0,0>,Rgb<205,0,205>,Rgb<205,62,115>,Rgb<205,205,0>,Rgb<205,79,0>,Rgb<178,205,205>>>,OriginalBlastL<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,Red>,Red,Red,Red,Red,Red,LightYellow,Blue,Blue,Red,Blue,Red>>,LockupL<Strobe<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,Rgb<200,255,255>>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,White,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Yellow>,Black,20,16>,Strobe<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,White>,White,White,White,White,White,White,White,White,White,White,Yellow>,Black,20,16>>,LockupTrL<AlphaL<Mix<TwistAngle<>,RandomFlicker<Red,Black>,RandomFlicker<Yellow,Red>>,SmoothStep<Int<28000>,Int<5000>>>,TrWipeIn<600>,TrFade<300>,SaberBase::LOCKUP_MELT>,SimpleClashL<Strobe<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,Yellow>,Yellow,Yellow,Yellow,White,Red,Yellow,Yellow,Yellow,White,White,Yellow>,Black,28,25>,260>,InOutTrL<TrWipe<500>,TrWipeInX<WavLen<EFFECT_RETRACTION>>>,TransitionEffectL<TrConcat<TrWipe<1000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrDelay<2000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrWipeIn<1000>>,EFFECT_BATTERY_LEVEL>>>>("~ ~ 0"),
  167.  
  168. // Accent LED 1 Red: ("~ ~ 0"),
  169.  
  170. // Accent LED 2 Green: ("~ ~ 0"),
  171.  
  172. // Bluetooth Module:
  173. StylePtr<ON>(),
  174. "graflex"},
  175.  
  176.  
  177. // **************************
  178.  
  179.  
  180. { "PreFont1;FontPrem/ANHGrfx2;Shared/Random;Shared/Function", "tracks/ANH_Track6.wav",
  181. // Main Blade:
  182. StylePtr<Layers<Layers<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,DeepSkyBlue>,Blue,Cyan,DodgerBlue,Green,Rgb<28,255,28>,Red,Magenta,Rgb<255,80,154>,Yellow,Orange,Azure>,RandomL<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,Rgb<0,107,205>>,Rgb<0,0,205>,Rgb<0,205,205>,Rgb<0,60,205>,Rgb<0,205,0>,Rgb<22,205,22>,Rgb<205,0,0>,Rgb<205,0,205>,Rgb<205,62,115>,Rgb<205,205,0>,Rgb<205,79,0>,Rgb<178,205,205>>>,RandomL<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,Rgb<0,68,125>>,Rgb<0,0,125>,Rgb<0,125,125>,Rgb<0,35,125>,Rgb<0,125,0>,Rgb<14,125,14>,Rgb<125,0,0>,Rgb<125,0,125>,Rgb<125,40,77>,Rgb<125,125,0>,Rgb<125,48,0>,Rgb<110,125,125>>>>,OriginalBlastL<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,Red>,Red,Red,Red,Red,Red,LightYellow,Blue,Blue,Red,Blue,Red>>,LockupL<Strobe<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,Rgb<200,255,255>>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,White,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Yellow>,Black,20,16>,Strobe<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,White>,White,White,White,White,White,White,White,White,White,White,Yellow>,Black,20,16>>,LockupTrL<AlphaL<Mix<TwistAngle<>,RandomFlicker<Red,Black>,RandomFlicker<Yellow,Red>>,SmoothStep<Int<28000>,Int<5000>>>,TrWipeIn<600>,TrFade<300>,SaberBase::LOCKUP_MELT>,SimpleClashL<Strobe<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,Yellow>,Yellow,Yellow,Yellow,White,Red,Yellow,Yellow,Yellow,White,White,Yellow>,Black,28,25>,260>,InOutTrL<TrWipe<500>,TrWipeInX<WavLen<EFFECT_RETRACTION>>>,TransitionEffectL<TrConcat<TrWipe<1000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrDelay<2000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrWipeIn<1000>>,EFFECT_BATTERY_LEVEL>>>("~ ~ 0"),
  183.  
  184. // Accent LED 1 Red: ("~ ~ 0"),
  185.  
  186. // Accent LED 2 Green: ("~ ~ 0"),
  187.  
  188. // Bluetooth Module:
  189. StylePtr<ON>(),
  190. "graflex"},
  191.  
  192. };
  193. // *************************************************************************
  194. // *************************************************************************
  195. Preset lgt[] = {
  196.  
  197. { "PreFont2;FontPrem/ANHGrfx1;Shared/Luke;Shared/Function", "tracks/ANH_Track5.wav",
  198. // Main Blade:
  199. StylePtr<Layers<Layers<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,DeepSkyBlue>,Blue,Cyan,DodgerBlue,Green,Rgb<28,255,28>,Red,Magenta,Rgb<255,80,154>,Yellow,Orange,Azure>,RandomL<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,Rgb<0,107,205>>,Rgb<0,0,205>,Rgb<0,205,205>,Rgb<0,60,205>,Rgb<0,205,0>,Rgb<22,205,22>,Rgb<205,0,0>,Rgb<205,0,205>,Rgb<205,62,115>,Rgb<205,205,0>,Rgb<205,79,0>,Rgb<178,205,205>>>,OriginalBlastL<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,Red>,Red,Red,Red,Red,Red,LightYellow,Blue,Blue,Red,Blue,Red>>,LockupL<Strobe<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,Rgb<200,255,255>>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,White,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Yellow>,Black,20,16>,Strobe<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,White>,White,White,White,White,White,White,White,White,White,White,Yellow>,Black,20,16>>,LockupTrL<AlphaL<Mix<TwistAngle<>,RandomFlicker<Red,Black>,RandomFlicker<Yellow,Red>>,SmoothStep<Int<28000>,Int<5000>>>,TrWipeIn<600>,TrFade<300>,SaberBase::LOCKUP_MELT>,SimpleClashL<Strobe<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,Yellow>,Yellow,Yellow,Yellow,White,Red,Yellow,Yellow,Yellow,White,White,Yellow>,Black,28,25>,260>,InOutTrL<TrWipe<500>,TrWipeInX<WavLen<EFFECT_RETRACTION>>>,TransitionEffectL<TrConcat<TrWipe<1000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrDelay<2000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrWipeIn<1000>>,EFFECT_BATTERY_LEVEL>>>>("~ ~ 0"),
  200.  
  201. // Accent LED 1 Red: ("~ ~ 0"),
  202.  
  203. // Accent LED 2 Green: ("~ ~ 0"),
  204.  
  205. // Bluetooth Module:
  206. StylePtr<ON>(),
  207. "graflex"},
  208.  
  209.  
  210. // **************************
  211.  
  212.  
  213. { "PreFont2;FontPrem/ANHGrfx2;Shared/Random;Shared/Function", "tracks/ANH_Track6.wav",
  214. // Main Blade:
  215. StylePtr<Layers<Layers<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,DeepSkyBlue>,Blue,Cyan,DodgerBlue,Green,Rgb<28,255,28>,Red,Magenta,Rgb<255,80,154>,Yellow,Orange,Azure>,RandomL<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,Rgb<0,107,205>>,Rgb<0,0,205>,Rgb<0,205,205>,Rgb<0,60,205>,Rgb<0,205,0>,Rgb<22,205,22>,Rgb<205,0,0>,Rgb<205,0,205>,Rgb<205,62,115>,Rgb<205,205,0>,Rgb<205,79,0>,Rgb<178,205,205>>>,RandomL<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,Rgb<0,68,125>>,Rgb<0,0,125>,Rgb<0,125,125>,Rgb<0,35,125>,Rgb<0,125,0>,Rgb<14,125,14>,Rgb<125,0,0>,Rgb<125,0,125>,Rgb<125,40,77>,Rgb<125,125,0>,Rgb<125,48,0>,Rgb<110,125,125>>>>,OriginalBlastL<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,Red>,Red,Red,Red,Red,Red,LightYellow,Blue,Blue,Red,Blue,Red>>,LockupL<Strobe<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,Rgb<200,255,255>>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,White,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Rgb<200,255,255>,Yellow>,Black,20,16>,Strobe<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,White>,White,White,White,White,White,White,White,White,White,White,Yellow>,Black,20,16>>,LockupTrL<AlphaL<Mix<TwistAngle<>,RandomFlicker<Red,Black>,RandomFlicker<Yellow,Red>>,SmoothStep<Int<28000>,Int<5000>>>,TrWipeIn<600>,TrFade<300>,SaberBase::LOCKUP_MELT>,SimpleClashL<Strobe<ColorSelect<Sum<Variation,IntArg<STYLE_OPTION_ARG,0>>,TrFade<50>,ColorChange<TrInstant,Yellow>,Yellow,Yellow,Yellow,White,Red,Yellow,Yellow,Yellow,White,White,Yellow>,Black,28,25>,260>,InOutTrL<TrWipe<500>,TrWipeInX<WavLen<EFFECT_RETRACTION>>>,TransitionEffectL<TrConcat<TrWipe<1000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrDelay<2000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrWipeIn<1000>>,EFFECT_BATTERY_LEVEL>>>("~ ~ 0"),
  216.  
  217. // Accent LED 1 Red: ("~ ~ 0"),
  218.  
  219. // Accent LED 2 Green: ("~ ~ 0"),
  220.  
  221. // Bluetooth Module:
  222. StylePtr<ON>(),
  223. "graflex"},
  224.  
  225. };
  226.  
  227. // *************************************************************************
  228. // *************************************************************************
  229. Preset charging[] = {
  230.  
  231. { "FontStd2/Charger;Shared/Function", "tracks/charger.wav",
  232. // Main Blade:
  233. ChargingStylePtr<BlackPower>(),
  234.  
  235. // Accent LED 1 Red: ("~ ~ 0"),
  236.  
  237. // Accent LED 2 Green: ("~ ~ 0"),
  238.  
  239. // Bluetooth Module:
  240. StylePtr<OFF>(),
  241. "charging"},
  242.  
  243.  
  244. };
  245.  
  246. // *************************************************************************
  247. struct Bluetooth {
  248. static constexpr float MaxAmps = 1.0;
  249. static constexpr float MaxVolts = 1000.0;
  250. static constexpr float P2Amps = 0.0;
  251. static constexpr float P2Volts = 0.0;
  252. static constexpr float R = 0.0;
  253. static const int Red = 0;
  254. static const int Green = 0;
  255. static const int Blue = 255;
  256. };
  257.  
  258. // *************************************************************************
  259. // KR V2 pixel strip blade lengths:
  260. // 88cm = 132 pixels.
  261. // 82cm = 122 pixels.
  262. // 72cm = 108 pixels.
  263.  
  264.  
  265. BladeConfig blades[] = {
  266.  
  267. // Use sequential numbers starting at 0 if using Sabersense Array Selector.
  268. { 76, // Hilt Only Reading: 75.
  269. // Main Blade:
  270. WS281XBladePtr<8, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3>>(),
  271. // Bluetooth Module:
  272. SimpleBladePtr<Bluetooth, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(),
  273. CONFIGARRAY(noblade), "save1"},
  274.  
  275.  
  276. { 71, // Short Test Blade. Reading: 72. Actual resistance: 62,400 ohms.
  277. // Main Blade:
  278. WS281XBladePtr<68, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3>>(),
  279. // Bluetooth Module:
  280. SimpleBladePtr<Bluetooth, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(),
  281. CONFIGARRAY(testblde), "save2"},
  282.  
  283.  
  284. { 64, // LGT 32 Inch Blade Reading: 60. Actual resistance: 28,600 ohms.
  285. // LGT 36 Inch Blade. Reading: 64. Actual resistance: 32.900 ohms.
  286. // Main Blade:
  287. WS281XBladePtr<114, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3>>(),
  288. // Bluetooth Module:
  289. SimpleBladePtr<Bluetooth, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(),
  290. CONFIGARRAY(lgt), "save3"},
  291.  
  292.  
  293. { 52, // Charge Plug Reading: 51. Actual resistance: 21,500 ohms.
  294. // Main Blade:
  295. WS281XBladePtr<10, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3>>(),
  296. // Bluetooth Module:
  297. SimpleBladePtr<Bluetooth, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(),
  298. CONFIGARRAY(charging), "save4"},
  299.  
  300. };
  301. #endif
  302. // *************************************************************************
  303.  
  304. #ifdef CONFIG_BUTTONS
  305. Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
  306. #if NUM_BUTTONS == 2
  307. Button AuxButton(BUTTON_AUX, auxPin, "aux");
  308. #endif
  309. #endif
  310.  
  311. /*
  312. If you need to swap the MAIN and AUX buttons over, use this:
  313. Button PowerButton(BUTTON_POWER, auxPin, "pow");
  314. Button AuxButton(BUTTON_AUX, powerButtonPin, "aux");
  315.  
  316. If you need the buttons to short to Batt+ or 3.3 Volt instead of Ground, use this:
  317. PullDownButton PowerButton(BUTTON_POWER, powerButtonPin, "pow");
  318. PullDownButton AuxButton(BUTTON_AUX, auxPin, "aux");
  319. */
  320.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement