Vex Addressable Led problem

Me and my team are trying to put LEDs on our robot this year and I can’t seem to get them to work the brain however I can get then to work with an Adriano uno just fine which i know isn’t legal

These are the lights I’m using

BTF-LIGHTING WS2812B RGB 5050SMD Individual Addressable 3.3FT 60(2x30) Pixels/m Flexible Black PCB Full Color LED Pixel Strip Dream Color IP30 Non-Waterproof for Bedroom,DIY Project Only DC5V https://a.co/d/eabutce

And this is how I have the lights hooked up


Why the inline resistor ?
What does the code look like ?
have you seen the possible issues I listed here.

10 Likes

You may also want to verify the wires into the LED match the outputs from the 3-wire by type and not necessarily by wire color.

1 Like

That’s how I Hooked up the lights to the Arduino and figured i would try it on the brain but i have tried both with the resister and without and the same result nothing turns on. I have seen that post however I am using the same lights that Sylvie did and that post and he said he had no issues without a buffer inline.

Ok i will try this! Thank you!

ok, then assuming no connection issue (as far as I can see wire colors are correct)
is V5 updated to vexos 1.1.2 ?
Are you using VEX VSCode extension or PROS ? post the code you are using.

7 Likes

I’m using pros and the code only sets up the LEDs and then set all to a color and updates them just 3 lines of code

ok, PROS has a bug, use this alternate constructor.

pros::ADILed Leds({INTERNAL_ADI_PORT,'A'}, 60);

@RanchSauce

perhaps this is fixed already, but the other constructor has a bug, seems on this line

_smart_port++; // for inherited functions this is necessary
5 Likes

lmao the port increment issue i thought we fixed this

i swear it was working when i tested it

5 Likes

interesting… thought we fixed this during testing…

Will fix this ASAP, thanks for the heads up.

3 Likes

After changing this the lights flashed red after a couple of minutes on the program but only for a split second, I’m going to get a 74AHCT125 and hook them up to that and see if that makes any difference.

ok, I had a buffer inline when I tested this morning.
Also, Leds.update() I don’t think is needed after set_all(), and also try another 3wire port, they all behave slightly differently due to component tolerance.

3 Likes

Ah I see what happened here, it looks like I forgot that there’s a seperate constructor depending on if you give it an ADI port or a port pair


fixed it in one place but not the other

oopsie

2 Likes



Hey do you mind checking the wiring on this and possibly showing me how you have your lights hooked up
and this is my code and my team’s expansion mech just for fun
https://www.youtube.com/shorts/2yPgugBHDEU

void initialize() {
pros::lcd::initialize();
pros::lcd::set_text(1, “Hello PROS User!”);

pros::lcd::register_btn1_cb(on_center_button);

sylib::initialize();

}

void opcontrol() {
// Create an addrled object
auto addrled = sylib::Addrled(5,5,64);
auto addrledP = sylib::Addrled(2,2,64);
// Set the LED strip to a gradient in HSV color space
// that displays a full range of hues
addrled.gradient(0xFF0000, 0xFF0005, 0, 0, false, true);
addrledP.turn_on();
// Cycle the colors at speed 10
addrled.cycle(*addrled, 10);

// Store the time at the start of the loop
std::uint32_t clock = sylib::millis();
while (true) {
    
    // 10ms delay to allow other tasks to run
    sylib::delay_until(&clock, 10);
}

}

Is something not working here? What’s the problem?

Also reposting your code to be legible

void initialize() {
pros::lcd::initialize();
pros::lcd::set_text(1, “Hello PROS User!”);

pros::lcd::register_btn1_cb(on_center_button);

sylib::initialize();
}

void opcontrol() {
 // Create an addrled object
 auto addrled = sylib::Addrled(5,5,64);
 auto addrledP = sylib::Addrled(2,2,64);
 // Set the LED strip to a gradient in HSV color space
 // that displays a full range of hues
 addrled.gradient(0xFF0000, 0xFF0005, 0, 0, false, true);
 addrledP.turn_on();
 // Cycle the colors at speed 10
 addrled.cycle(*addrled, 10);

 // Store the time at the start of the loop
 std::uint32_t clock = sylib::millis();
 while (true) {
    
    // 10ms delay to allow other tasks to run
    sylib::delay_until(&clock, 10);
  }
}
2 Likes

The lights just aren’t cutting on. I think it’s not a hardware issue, but I’m not sure where and I have also tried multiple 3-wire ports.

You’re defining the lights as being on port E on an ADI expander on smart port 5, and port B on an ADI expander on port 2 respectively.

You seem to have one light plugged into port E on the built-in ADI, and two supplemental power/ground lines (completely unneeded btw) plugged into port A.

This would be defined in sylib as

auto addrled = sylib::Addrled(22,5,64);
3 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.