2 activation buttons for Maul saber

My first build. I’m working on converting my Darth Maul dual sabers. For each saber, I want two momentary activation buttons; one top and one bottom. I could use a bit of advise, or a wire diagram be honest. Thanks any and all.

Converting from what?
Do they not already have 2 buttons?
This page shows pretty simply how 2 buttons get wired to a Proffieboard:
http://fredrik.hubbe.net/lightsaber/v5/

I’m converting my Hasbro sabers.

1 Like

Can you run two POW buttons in the config instead of one POW one AUX?

If you mean you want to have two buttons both act as power, then just wire them both to the same button pad.

1 Like

Might be better to put them on separate pads, and program them both as power buttons, like:

#ifdef CONFIG_BUTTONS
Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
Button PowerButton2(BUTTON_POWER, auxPin, "aux");
#endif

That way it’s really easy to re-program it to do something else later.

2 Likes

However, if what you want is one power button per blade, it’s going to be a bit more difficult as that is not actually supported in ProffieOS right now. (You would have to add code for it.)

This is what I meant.

I had an idea for this for future board revisions…

Would it be worth explioring the idea of having a pad on the board that lets you network them? So, soldering two boards so they can control each other? For example, you’d wire two power switches for each board, where one ignites one blade, the other ignites the blade for both boards?

2 Likes

The Rx/tx pads can already be used to hook up two boards together. However, you would also need to write some code that does something with it.

The V3 board has 3 serial ports…

1 Like

I figured as much. Thanks. I’ve decided I’m just going to have one kill switch and one power

That would be awesome !

Thanks, all who replied. That’s exactly what I did and works just fine.

This is exactly what I’m looking for as well! So, what you’re saying is that it’s possible to do even now with Proffie v2.2 already, right? Sadly, I know nothing about C++, I’ve mainly worked with Python in the past. Perhaps I could cobble something together, if I looked at other code inside Proffie OS. Do you know where I would need to add the code, like in the ‘blades’ folder or ‘buttons’ or ‘scripts’ or maybe in multiple places?

He’s saying it’s code not hardware, from what I understand.

Yup, I got that. I’ve considered wiring up 2 momentary buttons to the same pad and setting it as the power button, and then adding a latching switch as a physical circuit breaker on each LED positive. That would sort of solve the issue, but I can’t fit all the buttons in my build. If I could have just 1 momentary button per blade that could power it on and off, while still using only 1 Proffieboard, that would be ideal.

I would recommend wiring up the buttons to separate pads, otherwise you’re going to have to change it if/when you want to have them do different things.

Creating something that ignites each blade separately shouldn’t be that difficult. It’s mostly a matter of creating a new prop file. I would do it something like:

  1. When you press either of the buttons, the saber turns on, and the sound starts playing. However, only that blade turns on. This means making a new On() function which instead of calling SaberBase::TurnOn(), it would need to call a new function which avoids calling SaberBase::SB_On() on the first/second blade.
  2. When you press the other button, I would trigger a USER1 effect, which can play another ignition sound. Then SB_On() has to be called on any remaining blade(s).

Turning off would work in a similar way, but backwards.

None of this is super-complicated, assuming it works… There may be reasons why it doesn’t, in which case it gets more complicated.

1 Like

Maybe a tie into STATE_WAIT_FOR_ON?
A new function like SaberBase::OnPending() or maybe SaberBase::OnStandby()?

1 Like

I suppose this would also mean that if I do this, then the functionality of having the second side turn on automatically with a delay is also lost, right?

I had a look at the functions and classes, and although I’ve done some OOP with Java some time ago, I doubt that I can port that knowledge over too easily, especially if reasons why this solution doesn’t work are found.

And at the end of the day, it might not even be worth it and could prove to be too much extra hassle to constantly have to flip the thing over and push the other button, if the delayed second ignition is lost.

You could maybe tie the delayed ignition into one of the gestures?