[quote=“Cisco_Ugarte, post:19, topic:6920”]
#define bladePin 1
#define blade2Pin 2
#define bladePowerPin2 21
#define bladePowerPin3 22
#define powerButtonPin 11
okay, where do i put these?
[quote=“Cisco_Ugarte, post:19, topic:6920”]
#define bladePin 1
#define blade2Pin 2
#define bladePowerPin2 21
#define bladePowerPin3 22
#define powerButtonPin 11
okay, where do i put these?
oh nevermind i will remove it
@ryryog25
Okay, i got rid of the defines at the top and how is this for the blade config.
BladeConfig blades[] = {
{ 0,
SubBlade(16, 159, WS281XBladePtr<159, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >()),
SubBladeWithStride(0, 15, 2, nullptr),
SubBladeWithStride(1, 15, 2, nullptr),
, CONFIGARRAY(presets) },
};
#endif
#ifdef CONFIG_BUTTONS
Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
#endif
Remove that comma before CONFIGARRAY, since it’s a duplicate with the one before.
Otherwise that looks correct.
gotcha, let me plug that into arduino and see what is says.
no other errors in arduino, i will upload this to my board and put my test blade in.
just uploaded it and now my saber is yelling error in blade array at me. Is there something i missed?
#ifdef CONFIG_TOP
#include "proffieboard_v3_config.h"
#define NUM_BLADES 3
#define NUM_BUTTONS 1
#define VOLUME 1000
const unsigned int maxLedsPerStrip = 144;
#define CLASH_THRESHOLD_G 1.0
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
#define SHARED_POWER_PINS
#endif
#ifdef CONFIG_PROP
#include "../props/saber_sa22c_buttons.h"
#endif
#ifdef CONFIG_PRESETS
Preset presets[] = {
{ "TeensySF", "tracks/venus.wav",
StyleNormalPtr<CYAN, WHITE, 300, 800>(),
StyleNormalPtr<CYAN, WHITE, 300, 800>(),
StyleNormalPtr<CYAN, WHITE, 300, 800>(), "cyan"},
{ "SmthJedi", "tracks/mars.wav",
StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(),
StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(),
StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(), "blue"},
{ "SmthGrey", "tracks/mercury.wav",
StyleFirePtr<RED, YELLOW, 0>(),
StyleFirePtr<RED, YELLOW, 1>(),
StyleFirePtr<RED, YELLOW, 2>(), "fire"},
{ "SmthFuzz", "tracks/uranus.wav",
StyleNormalPtr<RED, WHITE, 300, 800>(),
StyleNormalPtr<RED, WHITE, 300, 800>(),
StyleNormalPtr<RED, WHITE, 300, 800>(), "red"},
{ "RgueCmdr", "tracks/venus.wav",
StyleFirePtr<BLUE, CYAN, 0>(),
StyleFirePtr<BLUE, CYAN, 1>(),
StyleFirePtr<BLUE, CYAN, 2>(), "blue fire"},
{ "TthCrstl", "tracks/mars.wav",
StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >(),
StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >(),
StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >(), "green"},
{ "TeensySF", "tracks/mercury.wav",
StyleNormalPtr<WHITE, RED, 300, 800, RED>(),
StyleNormalPtr<WHITE, RED, 300, 800, RED>(),
StyleNormalPtr<WHITE, RED, 300, 800, RED>(), "white"},
{ "SmthJedi", "tracks/uranus.wav",
StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>(),
StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>(),
StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>(), "yellow"},
{ "SmthGrey", "tracks/venus.wav",
StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(),
StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(),
StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(), "magenta"},
{ "SmthFuzz", "tracks/mars.wav",
StyleNormalPtr<Gradient<RED, BLUE>, Gradient<CYAN, YELLOW>, 300, 800>(),
StyleNormalPtr<Gradient<RED, BLUE>, Gradient<CYAN, YELLOW>, 300, 800>(),
StyleNormalPtr<Gradient<RED, BLUE>, Gradient<CYAN, YELLOW>, 300, 800>(), "gradient"},
{ "RgueCmdr", "tracks/mercury.wav",
StyleRainbowPtr<300, 800>(),
StyleRainbowPtr<300, 800>(),
StyleRainbowPtr<300, 800>(), "rainbow"},
{ "TthCrstl", "tracks/uranus.wav",
StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>(),
StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>(),
StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>(), "strobe"},
{ "TeensySF", "tracks/venus.wav",
&style_pov,
StyleNormalPtr<BLACK, BLACK, 300, 800>(),
StyleNormalPtr<BLACK, BLACK, 300, 800>(), "POV"},
{ "SmthJedi", "tracks/mars.wav",
&style_charging,
StyleNormalPtr<BLACK, BLACK, 300, 800>(),
StyleNormalPtr<BLACK, BLACK, 300, 800>(), "Battery\nLevel"}
};
BladeConfig blades[] = {
{ 0,
SubBlade(16, 159, WS281XBladePtr<159, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >()),
SubBladeWithStride(0, 15, 2, nullptr),
SubBladeWithStride(1, 15, 2, nullptr),
CONFIGARRAY(presets) },
};
#endif
#ifdef CONFIG_BUTTONS
Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
#endif
You have 159 in the sub blade for the end which is 0-indexed and inclusive (Google or ask gipitee if you don’t know what that means). But the overall blade length is 159. Your blade length needs to get longer or that first subblade needs to be shorter.
okay, so do i put a zero where the 16 is or make the 159 a 158?
Make 159, 158.
okay let me try that. thank you!
well that did something, but it went backwards now, now the in hilt pcb does not light up. everything else works but no lights now.
No lights at all? No error message? What was happening before? Why do you say backwards?
Something in the math doesn’t add up. There are 160 leds: 16 on PCB & 144 on main blade.
I believe your blade array should be like this:
{ 0,
SubBlade(16, 159, WS281XBladePtr<160, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >()),
SubBladeWithStride(0, 15, 2, nullptr),
SubBladeWithStride(1, 15, 2, nullptr),
CONFIGARRAY(presets) },
};
Indeed. That doesn’t account for things just not working, and realistically the blade is shorter, but for the sake of proper semantics and understanding that makes sense.
However, what I did forget about was the maxLedsPerStrip
. That needs to be increased now.
@Cisco_Ugarte can you try my blade array above and change
const unsigned int maxLedsPerStrip = 144;
to
const unsigned int maxLedsPerStrip = 160;
Does that help ?
Nope nothing, not even the in hilt pcb, I put the original code back in and it works like it did before just not lighting up the blade. I’ll try what you guys have just suggested.
And as @ryryog25 said, your main blade is probably shorter than 144 leds.
But with your blade config it might not be as straight forward as the page says.
To count your leds, I would personally use this config temporarily:
#ifdef CONFIG_TOP
#include "proffieboard_v3_config.h"
#define NUM_BLADES 1
#define NUM_BUTTONS 1
#define VOLUME 1000
const unsigned int maxLedsPerStrip = 160;
#define CLASH_THRESHOLD_G 1.0
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
#define SHARED_POWER_PINS
#endif
#ifdef CONFIG_PROP
#include "../props/saber_sa22c_buttons.h"
#endif
#ifdef CONFIG_PRESETS
Preset presets[] = {
{ "TthCrstl", "tracks/uranus.wav",
StylePtr<LengthFinder<>>(), "lenght finder"},
};
BladeConfig blades[] = {
{ 0,
WS281XBladePtr<160, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
CONFIGARRAY(presets) },
};
#endif
#ifdef CONFIG_BUTTONS
Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
#endif
Then follow the “handling steps” from the page above. Keep your main blade in the saber when you try this.
I can definitely give it a try, it will be a little bit before I can test it. I will have to wait untill I’m off work but I will certainly try it.
What is your original code ?
Edit: so pcb works (sometimes), but has the blade ever light-up ? Could there be a problem in the blade/blade side pcb?
Edit2: if the config above works with your hilt side pcb only, but not with your main blade attached, then you have a problem in your main blade, or at the connection point.