Asking for help programming servos for my wedding lightsaber build

I’m understanding the config portion of the code but to clarify about the

StylePtr<Layers<Rgb<240, 240, 240>, InOutTrL<TrInstant, TrInstant, Rgb<20, 20, 20>>>>()

Would that be a completely new blade style or would that be new line in the current blade styles.

“Yes.”

Those are both the same thing, unless we’re using terminology differently. You’re adding a blade and corresponding blade style to each preset.

The number of blades you have should match the number of styles you have per preset. And each style thus corresponds to a blade. In this example, the second blade is the ServoBladePtr, and so the second style controls the ServoBladePtr.

I’ve been having issues with the code I got the current proffie is and I used the config file I received with the lightsaber chassis but updated it with the information provided by ryryog25. I’ve been trying to resolve it myself but haven’t had any luck would it be possible for me to upload what I have to see what I am missing?

Sure thing. Make sure to include any error messages you’re getting or a detailed description of what is going wrong.

Sorry, it took a while to get everything. I included a notepad document with the errors I get when I try to upload the Proffie OS 7.14 from your site. The config file is mostly the one the chassis came with. I just made the changes and additions suggested by ryryog25.
Proffie OS Errors.txt (245.8 KB)
CONFIG_FILE.h (70.0 KB)

This is wrong:

#define StylePtr

What made you add that to your config file?

Wow, I can’t believe that removing it resolves most of the issues. Originally, I had more errors because the IDE did not like that the StylePtr was not defined. Then again, I also had other issues that I resolved. I just didn’t think having it defined would be the root of most of the issues now I just have 3 more errors.

In file included from C:.…\ProffieOS-v7.14\ProffieOS\ProffieOS.ino:604:
C:.…\ProffieOS-v7.14\ProffieOS\config\CONFIG_FILE.h:133:22: error: cannot convert ‘const char*’ to ‘StyleFactory*’ in initialization
133 | &style_charging, “Battery\nLevel” }
| ^~~~~~~~~~~~~~~~
| |
| const char*
C:.…\ProffieOS-v7.14\ProffieOS\config\CONFIG_FILE.h:137:5: error: ‘ServoBladePtr’ was not declared in this scope; did you mean ‘SaviBladePtr’?
137 | ServoBladePtr(),
| ^~~~~~~~~~~~~
| SaviBladePtr
C:.…\ProffieOS-v7.14\ProffieOS\config\CONFIG_FILE.h:137:35: error: expected primary-expression before ‘)’ token
137 | ServoBladePtr(),
| ^

exit status 1

Compilation error: cannot convert ‘const char*’ to ‘StyleFactory*’ in initialization

Thank you so much with all the help.

On your very last preset, you only have one bladestyle, but you have two blades set up, so you need to add another blade style. (&style_charging is a built-in bladestyle, so even though it looks a bit different it’s still a bladestyle) The additional blade style should be added before the “Battery\nLevel” preset name.

If your folder name is any indicator, this is because you’re using ProffieOS 7.14. Fredrik added the ServoBladePtr in the GitHub master, when is the current development version of ProffieOS. You’ll need that to use the ServoBladePtr. You can download the latest GitHub master from here. Click “<> Code” and then choose “Download ZIP”

Hi all,
I have been following along with this thread for a blaster project I’m working on. I have the master installed and my config checks out using the new “servobladeptr” and the blade style from above. When I power the board ( Proffie V3) up I get power across + and led 6. So all that said how do I wire a 3 wire servo to this setup? +,- from the battery and the led 6 for signal?
Thanks

servobladeptr is really meant to be used with one of the three Free1/2/3 pads, which would provide the data signal for the servo. severvobladeptr currently has no support for controlling the power to the servo, but that could be added if we need it.

Do I need to call out Free2 in the below statement ?
ServoBladePtr(), ?

out of curiosity in the case on servos would controlling power control speed ?

Okay I have got this far , but no luck yet

ServoBladePtr< ServoPWMPin<blade6Pin, bladePowerPin6> >()

What you want is simpler than that, just:

ServoBladePtr<blade6Pin>()
1 Like

Perfect as usual thanks so much, I’m using this
(StylePtr<Layers<Rgb<240, 240, 240>, InOutTrL<TrInstant, TrInstant, Rgb<20, 20, 20>>>>())
I pulled from above as a blade style but its no right. Any insight to how to tweak these numbers to get a different result , I tried but it did not help much.

What result are you getting, and what result do you want?

good question, its a 180 degree servo i want to have rotate when I push a button. The above blade style activates the servo you can feel it lock, and if I manually move it , the servo will return to position when the activation button is pressed. Really I would love to understand how the values correspond as it pertains to the servo. I went through the stuff posted on github and found all the servo stuff that was added… but having trouble figuring it out.

It’s not a lot to say really, low values makes the servo go one way, high values makes the servo go the other… Rgb<128,128,128> should be right in the middle.

Thank you for all the help I got the code working and uploaded it to the board. I hate to ask, but when I plug everything together the saber says fonts not found. I did not change anything on the SD card. I made the suggested changes to the config file, and I did get the latest master os from GitHub. Any suggestions on correcting this issue?

“Font directory not found” is very literal; one of the directories listed in your config file doesn’t exist on the SD card. I think the serial monitor will tell you which one.