Neopixel addressable ledstrip controlled by serial / bande led adressable serial

Bonjour à toutes et tous,

Je travaille avec des bandes LED RGBW addressables de chez Adafruit et je bloque sur le code. Ma contrainte est que l’Arduino reçoit par la liaison série une liste de 80 valeurs correspondant au niveau de blanc de chaque led.

Le code suivant me permet de contrôler individuellement le niveau de blanc de 63 LED mais pas davantage. Or j’en ai 80 par bandeau ! L’un(e) de vous aurait une idée pour débloquer la situation ?
Merci !

Hi everyone,
I’m working with RGBW addressable led strip from Adafruit - Neopixel and I got a problem on the code. My constraint : the Arduino receive a 80 values list by serial connexion, each value corresponding to the white level of one led.
The following code allows me to control white level of 63 leds but no more and I would like to control 80! Is anybody could give me some help?
Many thanks!

#include <Adafruit_NeoPixel.h>
#ifdef AVR
#include <avr/power.h>
#endif

#define PIN1 8

#define NUM_LEDS1 80

#define BRIGHTNESS 50

Adafruit_NeoPixel strip1 = Adafruit_NeoPixel (NUM_LEDS1, PIN1, NEO_GRBW + NEO_KHZ800);

int white[63] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

void setup() {
Serial.begin(115200);
strip1.begin();
}

void loop() {
if (Serial.available() >= 63) {
for(uint16_t i=0; i<63; i++) {
white = Serial.read();

  • }*
  • for(uint16_t i=0; i<63; i++) {*
    _ strip1.setPixelColor(i, strip1.Color(0, 0, 0, white*));_
    _
    } _
    strip1.show();
    _
    } _
    _
    }_
    _
    led-by-led1.ino (1.02 KB)*_

Right, first things first.

Please go and read the instructions, then go back and modify your post (use the “More → Modify” option to the bottom right of the post) to mark up the code (but it needs to be the complete code) as such so we can examine it conveniently and accurately. Most certainly do not post a “.ino” file as an attachment - that would mean that you are expecting people to actually load it to their IDE to look at it and that is extra unnecessary labour. In fact, attachments do not always show properly on different operating systems.

If you do not mark it up as code, the code you post often becomes garbled - note how it is now partially in italics and pieces are missing - and is certainly anything but easy to work with.

Note: Also mark up any data in the same way. This includes error output that you get from the IDE.

And - before you post any code, use “Auto Format” in the Tools menu of the IDE to properly present the code.

Try and avoid unnecessary white space (blank lines). You should only use these to separate functional blocks of code.

The following code allows me to control white level of 63 leds but no more and I would like to control 80!

So everywhere you code has the number 63, change this to 80.

Then you have to change the input buffer to be 80 bytes long. Or modify the code so that a byte at a time is stored in your array.

Change tous les '63' de ton code en '80'