I'm new to all of this, so "is it plugged in" style questions are absolutely welcome, though I do have everything plugged in.
What I'm attempting to accomplish is getting a MIDI input to affect an LED strip output by using an Arduino Uno, but at the moment I'm having problems with just the LED portion.
What I have is a WS2811 Pixel strip that has 3 LEDs per segment. The +/- wires are connected to this plug I had for a set of rope lights, rated for 12V, 700mA. Each set of 3 lights appears to be linked such that they are always all the same color/brightness/etc.
Hopefully my poor MS Paint skills can convey it, but the board setup looks like this:
I attempted to put the color bands on the resistors to match the way they are plugged in. The 1N914 diode has the black bar facing towards the higher numbers. The 6N138 Optocoupler has the little dot by the f30 slot. MIDI setup stuff was done following this.
Currently, the expected output is for the lights to turn on, all the same color, then half a second later turn off, then half a second later repeat. What is happening is rarely the strand is entirely off, instead often being partially lit, and most of the time it's multiple random colors and not the same each loop.
Any advice on how to at least get it to be the same color each time? I've also tried CRGB instead of CHSV, which didn't work, as well as FastLED.delay, which resulted in rapid flashing of random colors.
If you would have removed the breadboard and used straight lines instead of freehand things would be easier to see
So that does not deal with the midi at all so for now we can not even bother about the circuit for that part either.
I use slightly different values for the midi part (470R & 1K) but that probably works just fine.
Fastled.delay() just calls show() repeatedly until the time has expired. I find it best to avoid it, since it disables interrupts for extended period of time.
From your code
void colorLEDs(int clr){
for(int i = 0; i < NUM_LEDS; i++) {
leds[i] = CHSV(clr,255,255);
FastLED.show();
}
}
show() should be outside of the loop();
#define COLOR_ORDER RGB
That color order is not very common, most common is GRB or RBG, but of course this not your issue.
The program, although not ideal, should work as expected, so that leaves the ledstrip connections, which you have not shown us details of.
The strip and the arduino should share common GND !
So you have no Ground connection between the Arduino & the Ledstrip. That is your issue. Like that the data wire has no reference to GND at the receiving end.
So connect GND to GND and report back (add an actual wire between the strip & the arduino, don't go the long way around ! )
That was it, thanks. I've got GND from LED and negative of 12V line going directly into GND slots on the Uno, with the last GND slot going to the board. It seems to be working. Found out coloring goes BRG, and it is working as expected so far. Onto messing with MIDI stuff