If I were to use a servo in a blaster config, how could I get a style to respond to the reload (aux) button (EFFECT_RELOAD?) like it was a blade on/off (InOutTrL), so that it just flips back and forth between the two values… like an up/down position? Think the barrel flip of Cassian’s MW-20 from the Andor series (because that’s exactly what it is).
Additionally, how could I setup my preset to have one blade be working (responding to the fire button) in the up position, and when the servo flips, another blade is working?
I have a temporary config setup, but it isn’t nearly close to working as explained. I should also mention it is a continuous servo, so I’ll need a test config to play with the values to get a back and forth motion. I’ve assumed Rgb<20,20,20> and Rgb<128,128,128> instead of the example mentioned above.
Forgive me if this should be a new thread.
#include "proffieboard_v3_config.h"
#define NUM_BLADES 5
#define NUM_BUTTONS 2
#define VOLUME 2500
const unsigned int maxLedsPerStrip = 144;
#define CLASH_THRESHOLD_G 2.0
#define ENABLE_AUDIO
#define ENABLE_WS2811
#define ENABLE_SD
#define SAVE_STATE
#define DISABLE_DIAGNOSTIC_COMMANDS
#define DISABLE_BASIC_PARSER_STYLES
#define NO_REPEAT_RANDOM
#define DELAYED_OFF
#define ORIENTATION ORIENTATION_USB_TOWARDS_BLADE
#define BLASTER_ENABLE_AUTO
#define BLASTER_SHOTS_UNTIL_EMPTY 30 // Adjust the number based on your preference
#define BLASTER_JAM_PERCENTAGE 0 // Adjust 0-100% based on your preference
#endif
#ifdef CONFIG_PROP
#include "../props/blaster_BC_buttons.h"
#endif
#ifdef CONFIG_PRESETS
Preset presets[] = {
{ "A180;common", "common/tracks/A180.wav",
//Muzzle
StylePtr<Layers<
Black,
TransitionEffectL<TrConcat<TrDelay<100>,White,TrFade<200>,Red,TrFade<300>>,EFFECT_FIRE>,
TransitionEffectL<TrConcat<TrDelay<100>,DeepSkyBlue,TrFade<200>,Blinking<Black,Blue,100,500>,TrFade<300>>,EFFECT_STUN>,
LockupTrL<Layers<
TransitionLoopL<TrConcat<TrInstant,White,TrFade<50>,Red,TrFade<150>>>>,TrInstant,TrConcat<TrInstant,Rgb<50,0,0>,TrFade<400>>,SaberBase::LOCKUP_AUTOFIRE>>>(),
//Upper Barrel
StylePtr<Layers<
Black,
TransitionEffectL<TrConcat<TrWipe<100>,White,TrWipe<100>,Red,TrWipe<200>>,EFFECT_FIRE>,
TransitionEffectL<TrConcat<TrWipe<100>,DeepSkyBlue,TrWipe<100>,Blinking<Black,Blue,100,500>,TrWipe<200>>,EFFECT_STUN>,
LockupTrL<Layers<
TransitionLoopL<TrConcat<TrWipe<50>,Red,TrWipe<100>>>,
TransitionLoopL<TrConcat<TrInstant,AlphaL<White,Bump<Int<0>,Int<25000>>>,TrFade<150>>>,
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>>>(),
//Lower Barrel
StylePtr<Layers<
Black,
TransitionEffectL<TrConcat<TrWipe<100>,White,TrWipe<100>,Red,TrWipe<200>>,EFFECT_FIRE>,
TransitionEffectL<TrConcat<TrWipe<100>,DeepSkyBlue,TrWipe<100>,Blinking<Black,Blue,100,500>,TrWipe<200>>,EFFECT_STUN>,
LockupTrL<Layers<
TransitionLoopL<TrConcat<TrWipe<50>,Red,TrWipe<100>>>,
TransitionLoopL<TrConcat<TrInstant,AlphaL<White,Bump<Int<0>,Int<25000>>>,TrFade<150>>>,
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>>>(),
//Rumble Moter
StylePtr<Layers<
Black,
TransitionEffectL<TrConcat<TrDelay<100>,White,TrFade<200>,Red,TrFade<300>>,EFFECT_FIRE>,
TransitionEffectL<TrConcat<TrDelay<100>,White,TrFade<200>,Blinking<Black,Red,100,500>,TrFade<300>>,EFFECT_STUN>,
LockupTrL<Layers<
TransitionLoopL<TrConcat<TrInstant,White,TrFade<50>,Red,TrFade<150>>>>,TrInstant,TrConcat<TrInstant,Rgb<50,0,0>,TrFade<400>>,SaberBase::LOCKUP_AUTOFIRE>>>(),
//Servo
StylePtr<Layers<Black, TransitionEffectL<TrConcat<TrInstant,Rgb<128,128,128>,TrFade<150>>,EFFECT_RELOAD>>>(),
"preset_name" },
/* PRESET TEMPLATE
{ "FONT;common", "common/tracks/TRACK.wav",
//Muzzle
//Upper Barrel
//Lower Barrel
//Rumble Moter
//Servo
StylePtr<Layers<Rgb<128, 128, 128>, InOutTrL<TrInstant, TrInstant, Rgb<20, 20, 20>>>>(),
"preset_name" },
*/
},
};
BladeConfig blades[] = {
{ 0,
WS281XBladePtr<1, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(), /* muzzle */
WS281XBladePtr<20, blade2Pin, Color8::GRB, PowerPINS<bladePowerPin4> >(), /* upper barrel */
WS281XBladePtr<20, blade3Pin, Color8::GRB, PowerPINS<bladePowerPin5> >(), /* lower barrel */
SimpleBladePtr<CH1LED,NoLED,NoLED,NoLED,bladePowerPin1,-1,-1,-1>(), /* rumble motor */
ServoBladePtr<blade7Pin>(), /* servo, duh (free3)*/
CONFIGARRAY(presets) },
};
#endif
#ifdef CONFIG_BUTTONS
Button FireButton(BUTTON_FIRE, powerButtonPin, "fire");
Button ModeButton(BUTTON_MODE_SELECT, auxPin, "modeselect");
type or paste code here
EDIT: It looks like the servo might be this simple, but my question would remain about how to do something similar with the preset styles. I may do some digging to use a similar effect sequence as a layer wrapper.
StylePtr<EffectSequence<EFFECT_RELOAD,Rgb<20,20,20>,Rgb<128,128,128>>>(),
type or paste code here