Proffieboard V3.9 powering extendable/retractable blade design?

Hey everyone, my team and I are working on a saber with an extendable/retractable blade using the Proffieboard V3.9. We’ve done our best to read up the documentation but it seems like what we are doing is a bit of a special case. We had two main questions:

  1. We are using a motor and a driver to power the extension/retraction. Would editing the Arduino code that gets flashed to the Proffie to recognize button input and send a signal to the motor driver to turn on/off the motor accordingly be enough, or would we have to go in and change something with the config files as well?

  2. The LED strip we are using for the blade is a COB LED strip that is not addressable and just has two wires for positive and negative. Looking through the blade config generator, would using the config for the segmented string blade and hooking up the negative wire to the negative pad for LED1 be enough for the LED strip to turn on as planned? (Effectively acting as a single segment of the blade)

Any help would be greatly appreciated and thank you for taking the time to read this!

How does your motor work? Does it have its own controller that intelligently runs it “out” and then stops once the blade is fully extended, and then runs it “in” for retraction and stops when done?
Or is it just fed voltage of one polarity for a period of time, and then reverse polarity to retract?
In other words, how are you currently driving the motor?

1 Like

Thanks for replying! We plan to just use a button hold to run the motor one way, and then after release, button hold again to run it back the other way. Hopefully being able to store the button state (extended or retracted) in the Arduino code. In future versions we definitely want to intelligently stop it once the blade is fully extended and vice versa, but we are just looking to get it working for this version. We are using this driver Adafruit DRV8871 DC Motor Driver Breakout Board - 3.6A Max : ID 3190 : Adafruit Industries, Unique & fun DIY electronics and kits with H-bridge input control to run it one way for extension and then the other way for retraction.

99 times out of a 100, when you want to control something in ProffieOS, you want to use a “blade” to do it. It doesn’t matter if it’s a LED, a rumble motor or whatever, usually having the full expressive power of the styles system is what you want to control it.

If all we want is to run the motor for a set amount of time on extension and retraction, we could do that by hooking up the driver board to Free1 and Free2. Then we can set up a SimpleBlade to control Free1 and Free2 such that “Blue” means “OUT” and “Red” means “IN”. Then all we would need is a style that lights up blue for a few seconds on extension and red for a few seconds on retraction.

If there are endstops and stuff to take into account, that can probably be arranged as well by using ReadPin<> in the style.

However, extension/retraction on every activation might not be what you actually want. Having a separate button for it wouldn’t be particularly difficult, but will require some custom coding in the prop. Basically you would add a button to the code, but make it an unusual button, like “UP”. Then you create a new prop, which inherits from whatever prop you like, then override Event2() to catch the events related to your new button and do whatever digitailWrite() stuff you need. (But make sure to call the inherited Event2 so that it can handle all the other buttons.)

The only tricky part about writing code for ProffieOS compared to regular arduino code is that you can’t wait for anything to finish. ProffieOS has things to do, so everything you do has to be be done in small, quick increments. If you need any help with that, please let me know.

1 Like

Thank you so much for replying! My team and I really appreciate it and this is super helpful. Will try out custom coding in the prop with an unusual button and overriding Event2().

Regarding the non-addressable LED strip with just a positive and negative wire, am I right in assuming we can effectively treat it as the first segment in a string blade and it will light up as planned? For reference this is the LED strip we are using:

Apologies if any of these are obvious questions, I don’t have much experience with firmware but I’d love to learn more.

Ah, sorry, forgot to answer the second question.
For a single-color led strip, you just use SimpleBladePtr<> with a single color.
Documentation here:

1 Like

Great, thanks! Will test the full code tomorrow and see how it goes.