Sabersense

Daren Old Blaster

Apr 16th, 2026
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.33 KB | None | 0 0
  1. /* Basic blaster prop use.
  2.  
  3. Default Startup Mode = STUN
  4. Add the following to your config file if so desired:
  5. #define BLASTER_SHOTS_UNTIL_EMPTY 15 (whatever number)
  6. #define BLASTER_JAM_PERCENTAGE if this is not defined, random from 0-100%.
  7.  
  8. Blaster Buttons: FIRE and MODE
  9. (Blaster is always on with power, unless dedicated Power button is installed.)
  10.  
  11. Cycle Modes - Click MODE.
  12. Next Preset - Long click and release MODE.
  13. Previous Preset - Double click and hold MODE, release after a second.
  14. Reload - Hold MODE until Reloaded. (Or Click Reload if dedicated button insatlled)
  15. Start/Stop Track - Double click MODE.
  16. Fire - Click FIRE. (Hold to Auto Fire / Rapid Fire)
  17. Clip In - Clip Detect pad Latched On. ( or Hold Momentary button)
  18. Clip out - Clip Detect pad Latched Off. ( or release Momentary button)
  19. Unjam - Bang the blaster.
  20. - If there's a 3rd button for Power,
  21. Power On / Off - Click POWER.
  22.  
  23. Wavs to use for switching Modes:
  24. mdstun.wav
  25. mdkill.wav
  26. mdauto.wav
  27. - If these are not present, mode.wav will be used for all modes.
  28. - If no mode.wav either, then Talkie voice speaks selected mode.
  29. */
  30.  
  31. // *********************************************
  32. #ifdef CONFIG_TOP
  33. #include "proffieboard_v2_config.h"
  34. #define NUM_BLADES 3
  35. #define NUM_BUTTONS 2
  36. #define VOLUME 2500
  37. const unsigned int maxLedsPerStrip = 144;
  38. #define CLASH_THRESHOLD_G 2.0
  39. #define ENABLE_AUDIO
  40. #define ENABLE_WS2811
  41. #define ENABLE_SD
  42.  
  43. // OLED CONRTROLS:
  44. #define ENABLE_SSD1306
  45. #define PLI_OFF_TIME 30 * 1000
  46. // Controls how long battery display is shown on OLED after animations end.
  47. // Seconds multiplied by milliseconds. (30 * 1000 = 30 seconds).
  48. // #define OLED_FLIP_180 // Optional, use if viewfinder displays upside down.
  49.  
  50. #define SAVE_STATE
  51. // #define DISABLE_DIAGNOSTIC_COMMANDS
  52. #define DISABLE_BASIC_PARSER_STYLES
  53. #define NO_REPEAT_RANDOM
  54. // #define DELAYED_OFF
  55. #define BLASTER_DEFAULT_MODE MODE_KILL
  56. #define ENABLE_BLASTER_AUTO
  57. #define OLED_USE_BLASTER_IMAGES
  58. #define BLASTER_SHOTS_UNTIL_EMPTY 10
  59. #define BLASTER_JAM_PERCENTAGE 5
  60.  
  61. #define IDLE_OFF_TIME 5 * 60 * 1000
  62. // Minutes multiplied by seconds multiplied by milliseconds. (5 * 60 * 1000 = 5 minutes).
  63. #endif
  64.  
  65. #ifdef CONFIG_PROP
  66. #include "../props/blaster.h"
  67. #endif
  68.  
  69. // *********************************************
  70. #ifdef CONFIG_PRESETS
  71. Preset presets[] = {
  72. { "E-11;oled", "tracks/E-11.wav",
  73. // barrel
  74. StylePtr<Layers<
  75. Black,
  76. TransitionEffectL<TrConcat<TrWipe<100>,Black,TrWipe<100>,Black,TrWipe<200>>,EFFECT_FIRE>,
  77. TransitionEffectL<TrConcat<TrWipe<100>,DeepSkyBlue,TrWipe<100>,Blinking<Black,Blue,100,500>,TrWipe<200>>,EFFECT_STUN>,
  78. LockupTrL<Layers<
  79. TransitionLoopL<TrConcat<TrWipe<50>,Red,TrWipe<100>>>,
  80. TransitionLoopL<TrConcat<TrInstant,AlphaL<White,Bump<Int<0>,Int<25000>>>,TrFade<150>>>,
  81. TransitionLoopL<TrConcat<TrInstant,AlphaL<White,Bump<Int<0>,Int<25000>>>,TrFade<150>>>>,TrConcat<TrInstant,Rgb<255,100,100>,TrFade<150>>,TrJoin<TrConcat<TrInstant,AlphaL<Rgb<50,0,0>,Bump<Int<32768>,Int<60000>>>,TrFade<400>>,TrWipeX<Int<400>>,TrWaveX<Rgb<50,0,0>,Int<1800>,Int<40>,Int<400>,Int<5000>>>,SaberBase::LOCKUP_AUTOFIRE>>>(),
  82.  
  83. // muzzle
  84. StylePtr<Layers<
  85. Black,
  86. TransitionEffectL<TrConcat<TrDelay<25>,White,TrFade<200>,Red,TrFade<300>>,EFFECT_FIRE>,
  87. TransitionEffectL<TrConcat<TrDelay<100>,DeepSkyBlue,TrFade<200>,Blinking<Black,Blue,100,500>,TrFade<300>>,EFFECT_STUN>,
  88. LockupTrL<Layers<
  89. TransitionLoopL<TrConcat<TrInstant,White,TrFade<50>,Red,TrFade<150>>>>,TrInstant,TrConcat<TrInstant,Rgb<50,0,0>,TrFade<400>>,SaberBase::LOCKUP_AUTOFIRE>>>(),
  90.  
  91. // Power LED:
  92. StylePtr<Layers<Layers<Black,BlinkingL<Rgb<30,30,30>,Int<1500>,Int<500>>>,InOutHelperL<InOutFuncX<Int<300>,Int<800>>,Rgb<30,30,30>>>>(),
  93. "e-11"},
  94.  
  95.  
  96. // *****************
  97.  
  98.  
  99. { "EE-3;oled", "tracks/EE-3.wav",
  100. // barrel
  101. StylePtr<Layers<
  102. Black,
  103. TransitionEffectL<TrConcat<TrDelay<100>,Red,TrFade<200>,Black,TrFade<300>>,EFFECT_FIRE>,
  104. TransitionEffectL<TrConcat<TrWipe<25>,Red,TrWipe<25>,Black,TrWipe<25>,Red,TrWipe<25>,Black,TrWipe<25>,Red,TrWipe<25>,Black,TrWipe<25>>,EFFECT_STUN>,
  105. LockupTrL<Layers<
  106. TransitionLoopL<TrConcat<TrInstant,Black,TrFade<25>,Black,TrFade<25>>>>,TrInstant,TrConcat<TrInstant,Rgb<0,0,0>,TrFade<400>>,SaberBase::LOCKUP_AUTOFIRE>>>(),
  107.  
  108. // muzzle
  109. StylePtr<Layers<
  110. Black,
  111. TransitionEffectL<TrConcat<TrDelay<100>,Red,TrFade<200>,Black,TrFade<300>>,EFFECT_FIRE>,
  112. TransitionEffectL<TrConcat<TrWipe<25>,Red,TrWipe<25>,Black,TrWipe<25>,Red,TrWipe<25>,Black,TrWipe<25>,Red,TrWipe<25>,Black,TrWipe<25>>,EFFECT_STUN>,
  113. LockupTrL<Layers<
  114. TransitionLoopL<TrConcat<TrInstant,Black,TrFade<25>,Black,TrFade<25>>>>,TrInstant,TrConcat<TrInstant,Rgb<0,0,0>,TrFade<400>>,SaberBase::LOCKUP_AUTOFIRE>>>(),
  115.  
  116. // Power LED:
  117. StylePtr<Layers<Layers<Black,BlinkingL<Rgb<30,30,30>,Int<1500>,Int<500>>>,InOutHelperL<InOutFuncX<Int<300>,Int<800>>,Rgb<30,30,30>>>>(),
  118. "ee-3"},
  119.  
  120.  
  121. // *****************
  122.  
  123.  
  124. { "DLT-19;oled", "tracks/DLT-19.wav",
  125. // barrel
  126. StylePtr<Layers<
  127. Black,
  128. TransitionEffectL<TrConcat<TrWipe<100>,DarkOrange,TrWipe<100>,Black,TrWipe<200>>,EFFECT_FIRE>,
  129. TransitionEffectL<TrConcat<TrWipe<25>,DarkOrange,TrWipe<25>,Black,TrWipe<25>,DarkOrange,TrWipe<25>,Black,TrWipe<25>,DarkOrange,TrWipe<25>,Black,TrWipe<25>>,EFFECT_STUN>,
  130. LockupTrL<Layers<
  131. TransitionLoopL<TrConcat<TrWipe<30>,DarkOrange,TrWipe<30>>>,
  132. TransitionLoopL<TrConcat<TrInstant,AlphaL<DarkOrange,Bump<Int<0>,Int<18000>>>,TrFade<100>>>,
  133. TransitionLoopL<TrConcat<TrInstant,AlphaL<White,Bump<Int<0>,Int<15000>>>,TrFade<30>>>>,TrConcat<TrInstant,Rgb<255,100,100>,TrFade<200>>,TrJoin<TrConcat<TrInstant,AlphaL<Rgb<50,25,0>,Bump<Int<32768>,Int<60000>>>,TrFade<400>>,TrWipeX<Int<400>>,TrWaveX<Rgb<50,0,0>,Int<1800>,Int<40>,Int<400>,Int<5000>>>,SaberBase::LOCKUP_AUTOFIRE>>>(),
  134.  
  135. // muzzle
  136. StylePtr<Layers<
  137. Black,
  138. TransitionEffectL<TrConcat<TrDelay<100>,DarkOrange,TrFade<200>,Black,TrFade<300>>,EFFECT_FIRE>,
  139. TransitionEffectL<TrConcat<TrWipe<25>,DarkOrange,TrWipe<25>,Black,TrWipe<25>,DarkOrange,TrWipe<25>,Black,TrWipe<25>,DarkOrange,TrWipe<25>,Black,TrWipe<25>>,EFFECT_STUN>,
  140. LockupTrL<Layers<
  141. TransitionLoopL<TrConcat<TrInstant,DarkOrange,TrFade<25>,Black,TrFade<25>>>>,TrInstant,TrConcat<TrInstant,Rgb<50,0,0>,TrFade<400>>,SaberBase::LOCKUP_AUTOFIRE>>>(),
  142.  
  143. // Power LED:
  144. StylePtr<Layers<Layers<Black,BlinkingL<Rgb<30,30,30>,Int<1500>,Int<500>>>,InOutHelperL<InOutFuncX<Int<300>,Int<800>>,Rgb<30,30,30>>>>(),
  145. "dlt-19"},
  146.  
  147.  
  148. // *****************
  149.  
  150.  
  151. { "A180;oled", "tracks/A180.wav",
  152. // barrel
  153. StylePtr<Layers<
  154. Black,
  155. TransitionEffectL<TrConcat<TrWipe<100>,White,TrWipe<100>,Red,TrWipe<200>>,EFFECT_FIRE>,
  156. TransitionEffectL<TrConcat<TrWipe<100>,DeepSkyBlue,TrWipe<100>,Blinking<Black,Blue,100,500>,TrWipe<200>>,EFFECT_STUN>,
  157. LockupTrL<Layers<
  158. TransitionLoopL<TrConcat<TrWipe<50>,Red,TrWipe<100>>>,
  159. TransitionLoopL<TrConcat<TrInstant,AlphaL<White,Bump<Int<0>,Int<25000>>>,TrFade<150>>>,
  160. TransitionLoopL<TrConcat<TrInstant,AlphaL<White,Bump<Int<0>,Int<25000>>>,TrFade<150>>>>,TrConcat<TrInstant,Rgb<255,100,100>,TrFade<150>>,TrJoin<TrConcat<TrInstant,AlphaL<Rgb<50,0,0>,Bump<Int<32768>,Int<60000>>>,TrFade<400>>,TrWipeX<Int<400>>,TrWaveX<Rgb<50,0,0>,Int<1800>,Int<40>,Int<400>,Int<5000>>>,SaberBase::LOCKUP_AUTOFIRE>>>(),
  161.  
  162. // muzzle
  163. StylePtr<Layers<
  164. Black,
  165. TransitionEffectL<TrConcat<TrDelay<100>,White,TrFade<200>,Red,TrFade<300>>,EFFECT_FIRE>,
  166. TransitionEffectL<TrConcat<TrDelay<100>,DeepSkyBlue,TrFade<200>,Blinking<Black,Blue,100,500>,TrFade<300>>,EFFECT_STUN>,
  167. LockupTrL<Layers<
  168. TransitionLoopL<TrConcat<TrInstant,White,TrFade<50>,Red,TrFade<150>>>>,TrInstant,TrConcat<TrInstant,Rgb<50,0,0>,TrFade<400>>,SaberBase::LOCKUP_AUTOFIRE>>>(),
  169.  
  170. // Power LED:
  171. StylePtr<Layers<Layers<Black,BlinkingL<Rgb<30,30,30>,Int<1500>,Int<500>>>,InOutHelperL<InOutFuncX<Int<300>,Int<800>>,Rgb<30,30,30>>>>(),
  172. "a-180"},
  173.  
  174.  
  175. // *****************
  176.  
  177.  
  178. { "DL44;oled", "tracks/DL44.wav",
  179. // barrel
  180. StylePtr<Layers<
  181. Black,
  182. TransitionEffectL<TrConcat<TrWipe<100>,Red,TrWipe<100>,Black,TrWipe<200>>,EFFECT_FIRE>,
  183. TransitionEffectL<TrConcat<TrWipe<100>,White,TrWipe<100>,Blinking<Black,Red,100,500>,TrWipe<200>>,EFFECT_STUN>,
  184. LockupTrL<Layers<
  185. TransitionLoopL<TrConcat<TrWipe<50>,Red,TrWipe<150>>>,
  186. TransitionLoopL<TrConcat<TrInstant,AlphaL<White,Bump<Int<0>,Int<25000>>>,TrFade<200>>>,
  187. TransitionLoopL<TrConcat<TrInstant,AlphaL<White,Bump<Int<0>,Int<25000>>>,TrFade<200>>>>,TrConcat<TrInstant,Rgb<255,100,100>,TrFade<200>>,TrJoin<TrConcat<TrInstant,AlphaL<Rgb<50,0,0>,Bump<Int<32768>,Int<60000>>>,TrFade<400>>,TrWipeX<Int<400>>,TrWaveX<Rgb<50,0,0>,Int<1800>,Int<40>,Int<400>,Int<5000>>>,SaberBase::LOCKUP_AUTOFIRE>>>(),
  188.  
  189. // muzzle
  190. StylePtr<Layers<
  191. Black,
  192. TransitionEffectL<TrConcat<TrDelay<100>,Red,TrFade<200>,Black,TrFade<300>>,EFFECT_FIRE>,
  193. TransitionEffectL<TrConcat<TrDelay<100>,White,TrFade<200>,Blinking<Black,Red,100,500>,TrFade<300>>,EFFECT_STUN>,
  194. LockupTrL<Layers<
  195. TransitionLoopL<TrConcat<TrInstant,White,TrFade<50>,Red,TrFade<150>>>>,TrInstant,TrConcat<TrInstant,Rgb<50,0,0>,TrFade<400>>,SaberBase::LOCKUP_AUTOFIRE>>>(),
  196.  
  197. // Power LED:
  198. StylePtr<Layers<Layers<Black,BlinkingL<Rgb<30,30,30>,Int<1500>,Int<500>>>,InOutHelperL<InOutFuncX<Int<300>,Int<800>>,Rgb<30,30,30>>>>(),
  199. "dl-44"},
  200.  
  201.  
  202. // *****************
  203.  
  204.  
  205. { "NN14;oled", "tracks/NN14.wav",
  206. // barrel
  207. StylePtr<Layers<
  208. Black,
  209. TransitionEffectL<TrConcat<TrWipe<100>,White,TrWipeIn<100>,Red,TrWipe<200>>,EFFECT_FIRE>,
  210. TransitionEffectL<TrConcat<TrWipe<100>,DeepSkyBlue,TrWipe<100>,Blinking<Black,Blue,100,500>,TrWipe<200>>,EFFECT_STUN>,
  211. LockupTrL<Layers<
  212. TransitionLoopL<TrConcat<TrWipeIn<50>,Red,TrWipeIn<100>>>,
  213. TransitionLoopL<TrConcat<TrInstant,AlphaL<White,Bump<Int<0>,Int<25000>>>,TrFade<150>>>,
  214. TransitionLoopL<TrConcat<TrInstant,AlphaL<White,Bump<Int<0>,Int<25000>>>,TrFade<150>>>>,TrConcat<TrInstant,Rgb<255,100,100>,TrFade<150>>,TrJoin<TrConcat<TrInstant,AlphaL<Rgb<50,0,0>,Bump<Int<0>,Int<60000>>>,TrFade<400>>,TrConcat<TrDelay<416>,Black,TrWipeSparkTip<White,150,150>>,TrWaveX<Rgb<50,0,0>,Int<1800>,Int<40>,Int<400>,Int<27500>>>,SaberBase::LOCKUP_AUTOFIRE>>>(),
  215.  
  216. // muzzle
  217. StylePtr<Layers<
  218. Black,
  219. TransitionEffectL<TrConcat<TrDelay<100>,White,TrFade<200>,Rgb<180,0,0>,TrFade<300>>,EFFECT_FIRE>,
  220. TransitionEffectL<TrConcat<TrDelay<100>,DeepSkyBlue,TrFade<200>,Blinking<Black,Blue,100,500>,TrFade<300>>,EFFECT_STUN>,
  221. LockupTrL<Layers<
  222. TransitionLoopL<TrConcat<TrInstant,White,TrFade<50>,Red,TrFade<150>>>>,TrInstant,TrConcat<TrInstant,Rgb<50,0,0>,TrFade<400>>,SaberBase::LOCKUP_AUTOFIRE>>>(),
  223.  
  224. // Power LED:
  225. StylePtr<Layers<Layers<Black,BlinkingL<Rgb<30,30,30>,Int<1500>,Int<500>>>,InOutHelperL<InOutFuncX<Int<300>,Int<800>>,Rgb<30,30,30>>>>(),
  226. "nn-14"},
  227.  
  228.  
  229. // *****************
  230.  
  231.  
  232. { "Westar;oled", "tracks/Westar.wav",
  233. // barrel
  234. StylePtr<Layers<
  235. Black,
  236. TransitionEffectL<TrConcat<TrWipe<100>,DarkOrange,TrWipe<100>,Black,TrWipe<200>>,EFFECT_FIRE>,
  237. TransitionEffectL<TrConcat<TrWipe<100>,Green,TrWipe<100>,Blinking<Black,Yellow,100,500>,TrWipe<200>>,EFFECT_STUN>,
  238. LockupTrL<Layers<
  239. TransitionLoopL<TrConcat<TrWipe<50>,DarkOrange,TrWipe<150>>>,
  240. TransitionLoopL<TrConcat<TrInstant,AlphaL<DeepSkyBlue,Bump<Int<0>,Int<25000>>>,TrFade<200>>>,
  241. TransitionLoopL<TrConcat<TrInstant,AlphaL<White,Bump<Int<0>,Int<25000>>>,TrFade<200>>>>,TrConcat<TrInstant,Rgb<255,100,100>,TrFade<200>>,TrJoin<TrConcat<TrInstant,AlphaL<Rgb<50,25,0>,Bump<Int<32768>,Int<60000>>>,TrFade<400>>,TrWipeX<Int<400>>,TrWaveX<Rgb<50,0,0>,Int<1800>,Int<40>,Int<400>,Int<5000>>>,SaberBase::LOCKUP_AUTOFIRE>>>(),
  242.  
  243. // muzzle
  244. StylePtr<Layers<
  245. Black,
  246. TransitionEffectL<TrConcat<TrDelay<100>,DarkOrange,TrFade<200>,Black,TrFade<300>>,EFFECT_FIRE>,
  247. TransitionEffectL<TrConcat<TrDelay<100>,Green,TrFade<200>,Blinking<Black,Yellow,100,500>,TrFade<300>>,EFFECT_STUN>,
  248. LockupTrL<Layers<
  249. TransitionLoopL<TrConcat<TrInstant,DeepSkyBlue,TrFade<50>,DarkOrange,TrFade<150>>>>,TrInstant,TrConcat<TrInstant,Rgb<50,0,0>,TrFade<400>>,SaberBase::LOCKUP_AUTOFIRE>>>(),
  250.  
  251. // Power LED:
  252. StylePtr<Layers<Layers<Black,BlinkingL<Rgb<30,30,30>,Int<1500>,Int<500>>>,InOutHelperL<InOutFuncX<Int<300>,Int<800>>,Rgb<30,30,30>>>>(),
  253. "westar-34"},
  254.  
  255.  
  256. // *****************
  257.  
  258.  
  259. { "BadBatch;oled", "tracks/BadBatch.wav",
  260. // barrel
  261. StylePtr<Layers<
  262. Black,
  263. TransitionEffectL<TrConcat<TrWipe<100>,White,TrWipe<100>,Blue,TrWipe<200>>,EFFECT_FIRE>,
  264. TransitionEffectL<TrConcat<TrWipe<100>,Magenta,TrWipe<100>,Blinking<Black,Black,100,500>,TrWipe<200>>,EFFECT_STUN>,
  265. LockupTrL<Layers<
  266. TransitionLoopL<TrConcat<TrWipe<25>,Blue,TrWipe<50>>>,
  267. TransitionLoopL<TrConcat<TrInstant,AlphaL<White,Bump<Int<0>,Int<25000>>>,TrFade<150>>>,
  268. TransitionLoopL<TrConcat<TrInstant,AlphaL<White,Bump<Int<0>,Int<25000>>>,TrFade<150>>>>,TrConcat<TrInstant,Rgb<0,0,50>,TrFade<150>>,TrJoin<TrConcat<TrInstant,AlphaL<Rgb<225,225,225>,Bump<Int<32768>,Int<60000>>>,TrFade<400>>,TrWipeX<Int<400>>,TrWaveX<Rgb<50,0,0>,Int<1800>,Int<40>,Int<400>,Int<5000>>>,SaberBase::LOCKUP_AUTOFIRE>>>(),
  269.  
  270. // muzzle
  271. StylePtr<Layers<
  272. Black,
  273. TransitionEffectL<TrConcat<TrDelay<100>,White,TrFade<200>,Blue,TrFade<300>>,EFFECT_FIRE>,
  274. TransitionEffectL<TrConcat<TrDelay<100>,Magenta,TrFade<200>,Blinking<Black,Black,100,500>,TrFade<300>>,EFFECT_STUN>,
  275. LockupTrL<Layers<
  276. TransitionLoopL<TrConcat<TrInstant,White,TrFade<25>,Blue,TrFade<100>>>>,TrInstant,TrConcat<TrInstant,Rgb<0,0,50>,TrFade<400>>,SaberBase::LOCKUP_AUTOFIRE>>>(),
  277.  
  278. // Power LED:
  279. StylePtr<Layers<Layers<Black,BlinkingL<Rgb<30,30,30>,Int<1500>,Int<500>>>,InOutHelperL<InOutFuncX<Int<300>,Int<800>>,Rgb<30,30,30>>>>(),
  280. "bad\nbatch"},
  281.  
  282.  
  283. // *****************
  284.  
  285.  
  286. { "MouthBlaster;oled", "tracks/medley1.wav",
  287. // barrel
  288. StylePtr<Layers<
  289. Black,
  290. TransitionEffectL<TrConcat<TrWipe<100>,White,TrWipe<100>,Black,TrWipe<200>>,EFFECT_FIRE>,
  291. TransitionEffectL<TrConcat<TrWipe<100>,White,TrWipe<100>,Blinking<Black,Black,100,500>,TrWipe<200>>,EFFECT_STUN>,
  292. LockupTrL<Layers<
  293. TransitionLoopL<TrConcat<TrWipe<50>,White,TrWipe<150>>>,
  294. TransitionLoopL<TrConcat<TrInstant,AlphaL<White,Bump<Int<0>,Int<25000>>>,TrFade<200>>>,
  295. TransitionLoopL<TrConcat<TrInstant,AlphaL<White,Bump<Int<0>,Int<25000>>>,TrFade<200>>>>,TrConcat<TrInstant,Rgb<0,0,0>,TrFade<200>>,TrJoin<TrConcat<TrInstant,AlphaL<Rgb<0,0,0>,Bump<Int<32768>,Int<60000>>>,TrFade<400>>,TrWipeX<Int<400>>,TrWaveX<Rgb<225,225,225>,Int<1800>,Int<40>,Int<400>,Int<5000>>>,SaberBase::LOCKUP_AUTOFIRE>>>(),
  296.  
  297. // muzzle
  298. StylePtr<Layers<
  299. Black,
  300. TransitionEffectL<TrConcat<TrDelay<100>,White,TrFade<200>,Black,TrFade<300>>,EFFECT_FIRE>,
  301. TransitionEffectL<TrConcat<TrDelay<100>,White,TrFade<200>,Blinking<Black,Black,100,500>,TrFade<300>>,EFFECT_STUN>,
  302. LockupTrL<Layers<
  303. TransitionLoopL<TrConcat<TrInstant,White,TrFade<50>,White,TrFade<150>>>>,TrInstant,TrConcat<TrInstant,Rgb<225,225,225>,TrFade<400>>,SaberBase::LOCKUP_AUTOFIRE>>>(),
  304.  
  305. // Power LED:
  306. StylePtr<Layers<Layers<Black,BlinkingL<Rgb<30,30,30>,Int<1500>,Int<500>>>,InOutHelperL<InOutFuncX<Int<300>,Int<800>>,Rgb<30,30,30>>>>(),
  307. "mouth\nblaster"},
  308.  
  309. };
  310.  
  311. // *********************************************
  312. // STANDARD 3mm ACCENTS LED
  313.  
  314. // 3mm Red
  315. // Use 100 ohm resistor.
  316. template<int milliohms = 100000>
  317. struct RedLED {
  318. static constexpr float MaxAmps = 0.02;
  319. static constexpr float MaxVolts = 2.1;
  320. static constexpr float P2Amps = 0.01;
  321. static constexpr float P2Volts = 1.8;
  322. static constexpr float R = milliohms / 1000.0;
  323. // LED color
  324. static const int Red = 255;
  325. static const int Green = 0;
  326. static const int Blue = 0;
  327. };
  328. // *********************************************
  329. BladeConfig blades[] = {
  330. { 0, SubBlade(0, 22, WS281XBladePtr<32, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >()), /* barrel */
  331. SubBlade(23, 31, NULL), /* muzzle */
  332. // Power LED:
  333. SimpleBladePtr<RedLED<100000>, NoLED, NoLED, NoLED, bladePowerPin5, -1, -1, -1>(),
  334. CONFIGARRAY(presets) },
  335. };
  336. #endif
  337.  
  338.  
  339. #ifdef CONFIG_BUTTONS
  340. Button FireButton(BUTTON_FIRE, powerButtonPin, "fire");
  341. Button ModeButton(BUTTON_MODE_SELECT, auxPin, "modeselect");
  342. #endif
  343.  
Advertisement
Add Comment
Please, Sign In to add comment