Hi everyone,
I’ve been working on using manual blade array switching and locking some arrays for use when blade is not detected and some different arrays for when a blade is inserted.
I modified Fett263 button prop to do this and it works for the very specific config I’m using but if I change things it’ll probably break. If someone wants to have a go at generalizing this/ making things easier to change, I’d be very grateful.
When there’s no blade, it locks to the first 2 arrays like I want. When I want to insert a blade, I need to flip the killswitch on and off again to sort of reset it and then the blade detect will change to the correct array. When I try to switch the blade array when a blade is inserted, it’s not locking to the correct array.
If anybody would like to have a go at improving/formalizing my cobbled together code, I’ve included it here.
My test config:
Bladeswitch.h
Bladeswitch.h (2.4 KB)
(in case the link doesn’t work)
Here is the part of the code I modified in Fett263’s button prop.
#ifdef FETT263_MANUAL_BLADE_ARRAY
void NextBladeArray() {
if (!use_fake_id_) best_config_before_faking_ = current_config - blades;
size_t next_array = (current_config - blades + 1) % NELEM(blades);
if ( blade_detected_ = false) next_array=next_array;
else if (blade_detected_ = true && next_array >1) next_array = 0;
else next_array=next_array;
fake_id_ = blades[next_array].ohm;
use_fake_id_ = true;
FindBladeAgain();
PlayArraySound();
