I’ve always been the type of person that would rather code a website in notepad than Dreamweaver. I’ve never coded much, but when I do, I like to understand the code and what it is doing.
I started building FX sabers three months ago. I have completed 11 so far and have used Proffieboard v3.9 in all of them. I taught myself enough to write configuration files for each. I have Crystal Chamber LEDs in some, and I’ve implemented Bluetooth (in the ones with enough space) and custom saber fonts for each saber. My next builds will utilize OLED screens in a chassis of my own design, printed on my Raise3D Pro 3 Plus printer.
Three of my sabers use red and green accent LEDs that I’ve implemented in different ways. I wired one saber with the accents as sub-blades. The other two have the accent LEDs as separate blades. However, all three utilize the same blade styles to illuminate.
I use this code to turn on the LEDs:
//Red Accent LED
StyleNormalPtr<RED, RED, 300, 800>(),
//Green Accent LED
StyleNormalPtr<GREEN, GREEN, 300, 800>(),
I also have code (I don’t know where it came from) that makes the accent LEDs blink in a somewhat random pattern:
//Red Accent LED
StylePtr<InOutHelper<Blinking<Red, Black, 2000, 200>,1,1,Sequence<RED, BLACK, 100, 80,
0b0000000000000000,0b1010101010101010,0b1010101000000000,0b0000000000000000,0b1010101010101010>>>(),
//Green Accent LED
StylePtr<InOutHelper<Blinking<Green,Blinking<Green, Black, 300, 500>,3000,500>,1,1,Sequence<GREEN, BLACK, 100, 80, 0b1010101010101010,0b0000000000000000,0b0000000000000001,0b1010101010101010,0b0101000000000000>>>(),
I’ve mixed both pieces of code to create different accent light effects for different blade styles (both on, one on & one blinking, both blinking, etc.).
My issue is that the random blinking occurs even when the saber blade is off. I’d like them to stay off when the saber is off and only start blinking when the saber is active. I understand that the “InOutHelper” is the key to this, but I do not understand how it works. I’ve tried removing this part from the code (and the associated > at the end), but I get an error in verification.
What I’d like to know is how to modify the code to act the way I have described. More than that though, I’d like to understand what each piece of the code is doing and how it affects the light.
What I [think] I know:
The green blinks more than the red, and I’m fairly certain that is due to the fact that the green implements two “BLINKING” calls that break up the sequence even more. The five long strings at the end look like binary, except for the 0b at the beginning. But maybe this is a type of call that indicates the rest of the string IS binary. I’m sure that the numeric values are time (most likely in milliseconds) that the various functions are in effect. I don’t know the difference between “StylePtr” and “StyleNormalPtr” and why one would be used over the other.
I’ve seen threads where people want accent lights to be on when the blade is off, but not the other way around.
If anybody could shed some blinking light on the subject, I’d be most appreciative.
Thanks!