Welcome! Log In Create A New Profile

Advanced

NEOPIXEL_IS_SEQUENTIAL

Posted by DrumClock 
NEOPIXEL_IS_SEQUENTIAL
August 15, 2020 02:44PM
I have connected a LED strip WS2812B with 20 chips.
Color switching with M150 is functional.
But it doesn't work for me
#define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.

Settings below.
Where am I wrong?



// Support for Adafruit Neopixel LED driver
#define NEOPIXEL_LED
#if ENABLED(NEOPIXEL_LED)
  #define NEOPIXEL_TYPE   NEO_GRB // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
  #define NEOPIXEL_PIN    31       // LED driving pin
  //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE
  //#define NEOPIXEL2_PIN    5
  #define NEOPIXEL_PIXELS 20       // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used
  #define NEOPIXEL_IS_SEQUENTIAL   // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
  #define NEOPIXEL_BRIGHTNESS 127  // Initial brightness (0-255)
  //#define NEOPIXEL_STARTUP_TEST  // Cycle through colors at startup

  // Use a single Neopixel LED for static (background) lighting
  //#define NEOPIXEL_BKGD_LED_INDEX  0               // Index of the LED to use
  //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W
#endif
Re: NEOPIXEL_IS_SEQUENTIAL
August 15, 2020 10:30PM
Looks very disabled.

code is in #if 0 block. ie never active.
Re: NEOPIXEL_IS_SEQUENTIAL
August 15, 2020 10:44PM
ok that seems to be old code in the #if 0 blocks, no longer used

but there is new code meant to do this in Leds.cpp

I managed to get it working but starts at wrong led... still playing with it
Re: NEOPIXEL_IS_SEQUENTIAL
August 15, 2020 11:01PM
Ok get you coding glasses on and try this.

Edit Marlin/src/feature/leds/leds.cpp

Find the following lines (around line 100)

    if (isSequence) {
      neo.set_pixel_color(nextLed, neocolor);
      neo.show();
      if (++nextLed >= neo.pixels()) nextLed = 0;
      return;
    }

this is the code that does sequential led activation. but it is never activated.

just above this code add
    #if ENABLED(NEOPIXEL_IS_SEQUENTIAL) 
      isSequence = true;
    #endif

this works for me, with simple M150 G30 repeated a number of times gets a new led each time.

NB currently this breaks Index mode (ie setting individual neopixels)

Edited 1 time(s). Last edit at 08/15/2020 11:03PM by Dust.
Re: NEOPIXEL_IS_SEQUENTIAL
August 15, 2020 11:58PM
Normally this is only ever used by PRINTER_EVENT_LEDS, not by M150
Re: NEOPIXEL_IS_SEQUENTIAL
August 16, 2020 03:45AM
HI,
I modified the program.

#ifdef NEOPIXEL_BKGD_LED_INDEX
      if (NEOPIXEL_BKGD_LED_INDEX == nextLed) {
        if (++nextLed >= neo.pixels()) nextLed = 0;
        return;
      }
    #endif

    neo.set_brightness(incol.i);

    #if ENABLED(NEOPIXEL_IS_SEQUENTIAL) 
      isSequence = true;
    #endif

    if (isSequence) {
      neo.set_pixel_color(nextLed, neocolor);
      neo.show();
      if (++nextLed >= neo.pixels()) nextLed = 0;
      return;
    }

    neo.set_color(neocolor);

  #endif

  #if ENABLED(BLINKM)




Now after sending the M150, one LED is always set and then another and another. After reaching the full number (20), the LED No. 1 is set again with another command M150

I thought that the NEOPIXEL_IS_SEQUENTIAL function sets the LEDs automatically based on the HotBed or Hotends temperature. But if I set the heating, nothing happens?

Thank you for the explanation.

Edited 1 time(s). Last edit at 08/16/2020 03:47AM by DrumClock.
Re: NEOPIXEL_IS_SEQUENTIAL
August 16, 2020 04:31AM
It should when heating... haven't tested that... test controller, no real heaters!
Re: NEOPIXEL_IS_SEQUENTIAL
August 16, 2020 04:56AM
the PRINTER_EVENT_LEDS function is active when printing with "onboard SD".
If I print from TFT SD in the touch screen which is connected via RS232,
then the NEOPIXEL LED does not work.

Edited 1 time(s). Last edit at 08/16/2020 04:56AM by DrumClock.
Re: NEOPIXEL_IS_SEQUENTIAL
August 17, 2020 07:59PM
PRINTER_EVENT_LEDS should work (whether sequential or not) when an M109 or M190 is executed, whether this is through host software such as OctoPrint or from an SD print. It will not trigger when you do an M104 or M140 since there's no wait involved. It's possible that there's a bug in the sequential code but I know it works with sequential disabled.

It shouldn't be necessary to set isSequence explicitly in the function because it's passed in from the caller (the pel_set_rgb() function).

Edited 1 time(s). Last edit at 08/17/2020 08:05PM by MMcLure.
Re: NEOPIXEL_IS_SEQUENTIAL
August 18, 2020 12:20PM
Hi,
Unfortunately, even if I use M109 or M190 in G-code, the PRINTER_EVENT_LEDS
function is not active when printing from FTF SD.
Re: NEOPIXEL_IS_SEQUENTIAL
April 21, 2021 04:07PM
Hello all, Just ran into this post after installing neopixels (BTF-LIGHTING WS2812B RGB 5050SMD) to my SKR1.4 turbo / TFT35. Was wondering if this was solved, if so can anyone share how? I have 3 weeks trying to figure it out but I am unable to.
I reach out to Bigtree via email and they stated that its does not support it, but on discord, Facebook people have been able to get it to work. When I ask for help they all ways point to marlin settings but do not share any additional information. I was going to give up until I saw a video as proof that it work (video below). I ask and I have not receive any response.
[www.youtube.com]

I am having similar problems.
In marlin mode the Neopixels have sequence (starts off blue and fades to red when heating up, turns green when the print is complete.....), In touch mode nothing (only can turn on/off manually and change the colors).
I have currently a DC/DC converter / Neopixel pin P1.24.

These are my settings in marlin
// Support for Adafruit NeoPixel LED driver
#define NEOPIXEL_LED
#if ENABLED(NEOPIXEL_LED)
#define NEOPIXEL_TYPE NEO_GRB // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
#define NEOPIXEL_PIN P1_24 // LED driving pin
//#define NEOPIXEL2_TYPE NEOPIXEL_TYPE
//#define NEOPIXEL2_PIN 5
#define NEOPIXEL_PIXELS 20 // Number of LEDs in the strip. (Longest strip when NEOPIXEL2_SEPARATE is disabled.)
#define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
#define NEOPIXEL_BRIGHTNESS 255 // Initial brightness (0-255)
#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup

// Support for second Adafruit NeoPixel LED driver controlled with M150 S1 ...
//#define NEOPIXEL2_SEPARATE
#if ENABLED(NEOPIXEL2_SEPARATE)
#define NEOPIXEL2_PIXELS 15 // Number of LEDs in the second strip
#define NEOPIXEL2_BRIGHTNESS 127 // Initial brightness (0-255)
#define NEOPIXEL2_STARTUP_TEST // Cycle through colors at startup
#else
//#define NEOPIXEL2_INSERIES // Default behavior is NeoPixel 2 in parallel
#endif

// Use a single NeoPixel LED for static (background) lighting
//#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use
//#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W
#endif


Any help would be greatly appreciated

Edited 2 time(s). Last edit at 04/21/2021 04:07PM by Bluediablito.
Sorry, only registered users may post in this forum.

Click here to login