0

here's what I got.

ESP8266-12E (actually built by NodeMcu, but the pinout is same as the link) https:// acrobotic.com/acr-00018

LED strip uses WS2811 chip

The code I borrowed from works and partially works with the mods I made. I'll just post the sections I changed, but the complete code is here. https://github.com/jasoncoon/esp8266-fastled-webserver

What it does The original code connects to the wifi Uploads a control page when you point a separate browser to it's IP Changes the pattern/colors with your input

My changes The original program is setup for one long LED strip which I tested to verify everything worked. I then cut the strip into three sections for under cabinet lighting. I want them each on their own pin so I can control the delay between them (by making strips seem longer than they are).

The issue The problem is after cutting the strip and connecting, not all three strips light together. (to the best of my memory from last night) With all 3 in, only strip 1 works Unplug strip 3 causes 1 and 2 to work Unplug strip 2 causes 1 to work and 3 still doesn't work Unplug strip 1 causes 3 to work and 2 still doesn't work (I think it was that order) Each strip alone works in their respective pins Keep in mind the original setup with one long strip did work just fine.

Code changes (with a little on either side to help find it in the original code) This first section was modified to account for different strips with different lengths

// the very next line is original, but I commented out to add data pins later
//#define DATA_PIN      8     // for Huzzah: Pins w/o special function:  #4, #5, #12, #13, #14; // #16 does not work :(
#define LED_TYPE      WS2811
#define COLOR_ORDER   BRG
#define STRIP_1       6     // seperate strips are numbered and added together to form one long chain
#define STRIP_2       67   // by adding extra leds, you add a delay so you don't jump a gap between strips too fast
#define STRIP_3       27
#define STRIP_12      STRIP_1 + STRIP_2
#define NUM_LEDS      STRIP_1 + STRIP_2 + STRIP_3

#define MILLI_AMPS         10000     // IMPORTANT: set here the max milli-Amps of your power supply 5V 2A = 2000
#define FRAMES_PER_SECOND  120 // here you can control the speed. With the Access Point / Web Server the animations run a bit slower.

FastLED.addLeds was originally one line that is now 3.

  FastLED.addLeds<LED_TYPE, 5, COLOR_ORDER>(leds, 0, STRIP_1);         // for WS2812 (Neopixel)
  FastLED.addLeds<LED_TYPE, 6, COLOR_ORDER>(leds, STRIP_1, STRIP_2);
  FastLED.addLeds<LED_TYPE, 7, COLOR_ORDER>(leds, STRIP_12, STRIP_3);

The reason for cutting the LED strip is mounting locations. Strip_1 is between fridge and stove Strip_2 is between stove and sink Strip_3 is between sink and the wall

The reason for separating them out on the pins is that FastLED did not seem to have an easy way to update the patterns. With the current setup, I know it at least partially works without having to go through and modify the 8 or so patterns already in the program. With Strip_3 disconnected, strips 1 and 2 waved back and forth as one continuous strip. To add delay without changing the patterns, I just tell it that Strip_1 is longer. This gives the impression that a bead of light travels through the stove and sink unseen and is seen again on the next strip.

Here is the example I'm used for this setup. https://github.com/FastLED/FastLED/wiki/Multiple-Controller-Examples Half way down, "One array, many strips"

Disclaimer: I'm a mechanical engineer that didn't pay attention in school when we did the little programming req'd (hindsight on that one sucks). Anyway, I spent the last week and a half going through C++ tutorials and examples to get this far. Writing is going to be bad, but at least I recognize what 1/2 of the program is doing now.

Joel Spolsky
  • 33,372
  • 17
  • 89
  • 105
Fields
  • 21
  • 3
  • Not sure why I got marked down. Clarification on that one would be useful. I had gotten this "mostly" working with a ton a research, but am stuck on one part. – Fields Aug 17 '17 at 18:44
  • Between us MechE's... folks on this site are pretty picky about how questions are formed. ;-) I didn't downvote, but your _specific_ code question is unclear. Do you have a code problem? Or a circuit problem? Are you indexing the strips /LEDs correctly? – Mepix Aug 17 '17 at 19:40

1 Answers1

1

Try running your code without the extra length in Strip_1:

To add delay without changing the patterns, I just tell it that Strip_1 is longer. This gives the impression that a bead of light travels through the stove and sink unseen and is seen again on the next strip.

You may be experiencing an indexing problem with the LED strip by trying to access non existent pixels in your Neopixel strip. If this indeed the problem, implement a proper delay technique.

Mepix
  • 521
  • 1
  • 4
  • 15
  • Actually, the code currently does not have the delay. The reason I thought it may work is that when I tested the full strip, I accidentally told it 300 leds (only 100 addresses) and the wave would go out past the end leaving me wondering why it took so long to come back. – Fields Aug 17 '17 at 19:56
  • It works with strip_1, 2. The wave goes down as if they are connected. But it does not like having 3 pins to send data to, so to answer Mepix I think this is looking more like a circuit problem now. A real buggar since I'm using the same pwr, board and led strip from before. Thanks anyway, but I might be on the wrong forum then – Fields Aug 17 '17 at 20:03
  • Hmm. There goes my guess. I've found indexing problems are quite common with these things (at least with my projects). You've probably already done this, but have you swapped the order of the strips to make sure Strip_3 wasn't damaged when it was split? At this point (without more detail/circuit/your complete code), all I have are guesses... best of luck! – Mepix Aug 17 '17 at 20:13