strisce led in contemporanea con effetti diversi

Ciao a tutti, rieccomi qua dopo vari progetti e più esperienza, ma non riesco a fare questo:
ho n strisce led, su una faccio andare su e giù dei colori, la seconda blink rosso etc. In pratica ogni striscia può avere un suo effetto. Il problema è che nel loop {} passo da un effetto all'altro , in pratica finisce il primo e poi va al secondo e di conseguenza il primo si ferma.
Qeesta è la parte del codice loop

//striscia 0  
for(int a=0;a<100;a++){
   animationA();
   animationB();
   uint8_t ratio = beatsin8(2);                                // Alternate between 0 and 255 every minute
   // This inner loo= p will go over each led in the current strip, one at a time
    for(int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
    leds[0][i] = blend( leds2[i], leds3[i], ratio );
   }
  FastLED.show();  
   }
//striscia 1
 for(int a=0;a<100;a++){
   animationA();
   animationB();
   uint8_t ratio = beatsin8(2);                                // Alternate between 0 and 255 every minute
   // This inner loop will go over each led in the current strip, one at a time
    for(int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
    leds[1][i] = blend( leds2[i], leds3[i], ratio );
   }
  FastLED.show();  
   }
  //striscia 2
 for(int a=0;a<100;a++){
   animationA();
   animationB();
   uint8_t ratio = beatsin8(2);                                // Alternate between 0 and 255 every minute
   // This inner loop will go over each led in the current strip, one at a time
    for(int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
    leds[2][i] = blend( leds2[i], leds3[i], ratio );
   }
  FastLED.show();  
   } 
  // seguirebbero le altre striscie 
 //altri effetti
   coloriinlinea();
 }

//END LOOP

Praticamente striscia0 va a completamento(for a),poi parte stricia1 etcc. Io vorrei che stricia0 continuasse a fare l'effetto poi(dopo il ciclo for a) partisse striscia1 e che striscia0 continuasse, poi parte striscia2 e striscia 0 e 1 continuassero e così via.
Invece parte striscia1 e striscia0 si ferma (ed è corretto perchè il loop lavora così), ma non so come fare quanto vorrei! :slightly_frowning_face:

Questo tutto il codice

#include "FastLED.h"
#define BRIGHTNESS  64
#define NUM_STRIPS 7 //SETTE NON OTTO
#define NUM_LEDS_PER_STRIP 20
#define LED_TYPE    WS2812B
#define COLOR_ORDER GRB
//CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];
CRGB leds[NUM_STRIPS][NUM_LEDS_PER_STRIP];
#define UPDATES_PER_SECOND 100
//per animationA
CRGB leds2[NUM_LEDS_PER_STRIP];
CRGB leds3[NUM_LEDS_PER_STRIP];
int s = 0;
////////////////////////////

void setup() {
delay( 1000 ); // power-up safety delay
Serial.begin(9600);

    FastLED.addLeds<LED_TYPE, 4, COLOR_ORDER>(leds[0], NUM_LEDS_PER_STRIP).setCorrection( TypicalLEDStrip );
    FastLED.addLeds<LED_TYPE, 5, COLOR_ORDER>(leds[1], NUM_LEDS_PER_STRIP).setCorrection( TypicalLEDStrip );
    FastLED.addLeds<LED_TYPE, 6, COLOR_ORDER>(leds[2], NUM_LEDS_PER_STRIP).setCorrection( TypicalLEDStrip );
    FastLED.addLeds<LED_TYPE, 7, COLOR_ORDER>(leds[3], NUM_LEDS_PER_STRIP).setCorrection( TypicalLEDStrip );
    FastLED.addLeds<LED_TYPE, 8, COLOR_ORDER>(leds[4], NUM_LEDS_PER_STRIP).setCorrection( TypicalLEDStrip );
    FastLED.addLeds<LED_TYPE, 9, COLOR_ORDER>(leds[5], NUM_LEDS_PER_STRIP).setCorrection( TypicalLEDStrip );
    FastLED.addLeds<LED_TYPE, 10, COLOR_ORDER>(leds[6], NUM_LEDS_PER_STRIP).setCorrection( TypicalLEDStrip );

    FastLED.setBrightness(  BRIGHTNESS );
       
} //Setup()

void loop() {
 
//striscia 0  
for(int a=0;a<100;a++){
   animationA();
   animationB();
   uint8_t ratio = beatsin8(2);                                // Alternate between 0 and 255 every minute
   // This inner loo= p will go over each led in the current strip, one at a time
    for(int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
    leds[0][i] = blend( leds2[i], leds3[i], ratio );
   }
  FastLED.show();  
   }
//striscia 1
 for(int a=0;a<100;a++){
   animationA();
   animationB();
   uint8_t ratio = beatsin8(2);                                // Alternate between 0 and 255 every minute
   // This inner loop will go over each led in the current strip, one at a time
    for(int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
    leds[1][i] = blend( leds2[i], leds3[i], ratio );
   }
  FastLED.show();  
   }
  //striscia 2
 for(int a=0;a<100;a++){
   animationA();
   animationB();
   uint8_t ratio = beatsin8(2);                                // Alternate between 0 and 255 every minute
   // This inner loop will go over each led in the current strip, one at a time
    for(int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
    leds[2][i] = blend( leds2[i], leds3[i], ratio );
   }
  FastLED.show();  
   } 
  // seguirebbero le altre striscie 
 //altri effetti
   coloriinlinea();
 }

//END LOOP

void animationA() {                                             // running red stripe.

  for (int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
    uint8_t red = (millis() / 10) + (i * 12);                    // speed, length
    if (red > 128) red = 0;
    leds2[i] = CRGB(red, 0, 0);
  }
} // animationA()
  void animationB() {                                               // running green stripe in opposite direction.
  for (int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
    uint8_t green = (millis() / 5) - (i * 12);                    // speed, length
    if (green > 128) green = 0;
    leds3[i] = CRGB(0, green, 0);
  }
} // animationB()

void singolestrisce()
{
// This outer loop will go over each strip, one at a time
  for(int x = 0; x < NUM_STRIPS; x++) {
    // This inner loop will go over each led in the current strip, one at a time
    for(int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
      leds[x][i] = CRGB::Green;
      leds[x][i+1] = CRGB::White;
      leds[x][i+2] = CRGB::Red;
      FastLED.show();
      leds[x][i] = CRGB::Black;
      delay(10);
    }
  }
}//singolestrisce

void coloriinlinea(){
  for(int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
    // set our current dot to red, green, and blue
    leds[0][i] = CRGB::Gold;
    leds[1][i] = CRGB::Coral;
    leds[2][i] = CRGB::Aqua;
    leds[3][i] = CRGB::Yellow;
    leds[4][i] = CRGB::HotPink;
    leds[5][i] = CRGB::Magenta;
    leds[6][i] = CRGB::LightBlue;
    
    FastLED.show();
    // clear our current dot before we move on
    leds[0][i] = CRGB::Black;
    leds[1][i] = CRGB::Black;
    leds[2][i] = CRGB::Black;
    leds[3][i] = CRGB::Black;
    leds[4][i] = CRGB::Black;
    leds[5][i] = CRGB::Black;
    leds[6][i] = CRGB::Black;
   
    delay(100);
  }
  for(int i = NUM_LEDS_PER_STRIP-1; i >= 0; i--) {
    // set our current dot to red, green, and blue
    leds[0][i] = CRGB::Red;
    leds[1][i] = CRGB::Green;
    leds[2][i] = CRGB::Blue;
    leds[3][i] = CRGB::Red;
    leds[4][i] = CRGB::Green;
    leds[5][i] = CRGB::Blue;
    leds[6][i] = CRGB::Red;
   
    FastLED.show();
    // clear our current dot before we move on
    leds[0][i] = CRGB::Black;
    leds[1][i] = CRGB::Black;
    leds[2][i] = CRGB::Black;
    leds[3][i] = CRGB::Black;
    leds[4][i] = CRGB::Black;
    leds[5][i] = CRGB::Black;
    leds[6][i] = CRGB::Black;
    
    delay(100);
  }
}//coloriinlenea

Grazie a chi mi aiuta

Per ottenere gli effetti che vorresti non si può modificare il programma che hai creato, ma occorre rivederlo e riscriverlo completamente.

Il programma dovrebbe gestire i compiti con millis(),
qui un link che spiega come fare due operazioni contemporaneamente usando millis(), ovviamente l'esempio è per gestire due compiti, ma si possono gestire un numero di compiti-operazioni quanti ne servono.

http://www.leonardomiliani.com/2013/programmiamo-i-compiti-con-millis/

Il fatto che usando un ciclo for() ma anche while(), il programma può eseguire solo una operazione, cioè
mentre esegue il ciclo non può fare altro.
Utilizzando millis() come da esempio, le cose vengono eseguite al passare di un intervallo di tempo, e avendo più contatori di tempo, si possono eseguire più cose "contemporaneamente".In realtà passera un intervallo di tempo di frazioni di secondo, tra una cosa e l'altra, giusto il tempo del processore di eseguire le istruzioni del programma :slight_smile:

Ciao, potrebbe essere la soluzione, suona bene. Appena posso provo. Grazie

Ciao, non è la soluzione.
Io dovrei far partire la striscia1
dopo 5 secondi striscia2, con striscia 1 che continua a fare il suo ciclo
dopo altri 5 secondi striscia3, con striscia 1 e 2 che continuano. etc.

Credo che il problema sia per come è configurato il ciclo per singola linea, per miscelare i colori esegue sempre il loop
Con il seguente programma, le 7 linee funzionano tutte insieme facendo il suo lavoro.
Il problema è quando voglio che parta striscia0 e dopo 5 secondi striscia1 etcc.
Con cicli for, delay, o funzione looper myScheduler; si rallenta tutto in quanto va con i tempi previsti dalle nuove funzioni.

/* aanimations
 *
 * By: Can't recall where I found this.
 * 
 * Modified by: Andrew Tuline
 *
 * Date: January, 2017
 *
 * This sketch demonstrates how to blend between two animations running at the same time.
 * 
 */

#include "FastLED.h"
#define BRIGHTNESS  64
#define NUM_STRIPS 7 //SETTE NON OTTO
#define NUM_LEDS_PER_STRIP 20
#define LED_TYPE    WS2812B
#define COLOR_ORDER GRB
//CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];
CRGB leds[NUM_STRIPS][NUM_LEDS_PER_STRIP];
#define UPDATES_PER_SECOND 100
CRGB leds2[NUM_LEDS_PER_STRIP];
CRGB leds3[NUM_LEDS_PER_STRIP];

// Global variables can be changed on the fly.
uint8_t max_bright = 128;                                     // Overall brightness definition. It can be changed on the fly.


void setup() {

  delay(1000);                                                // Power-up safety delay.
  Serial.begin(9600);                                        // Initialize serial port for debugging.
    FastLED.addLeds<LED_TYPE, 4, COLOR_ORDER>(leds[0], NUM_LEDS_PER_STRIP).setCorrection( TypicalLEDStrip );
    FastLED.addLeds<LED_TYPE, 5, COLOR_ORDER>(leds[1], NUM_LEDS_PER_STRIP).setCorrection( TypicalLEDStrip );
    FastLED.addLeds<LED_TYPE, 6, COLOR_ORDER>(leds[2], NUM_LEDS_PER_STRIP).setCorrection( TypicalLEDStrip );
    FastLED.addLeds<LED_TYPE, 7, COLOR_ORDER>(leds[3], NUM_LEDS_PER_STRIP).setCorrection( TypicalLEDStrip );
    FastLED.addLeds<LED_TYPE, 8, COLOR_ORDER>(leds[4], NUM_LEDS_PER_STRIP).setCorrection( TypicalLEDStrip );
    FastLED.addLeds<LED_TYPE, 9, COLOR_ORDER>(leds[5], NUM_LEDS_PER_STRIP).setCorrection( TypicalLEDStrip );
    FastLED.addLeds<LED_TYPE, 10, COLOR_ORDER>(leds[6], NUM_LEDS_PER_STRIP).setCorrection( TypicalLEDStrip );

    FastLED.setBrightness(  BRIGHTNESS );
   
  set_max_power_in_volts_and_milliamps(5, 500);               // FastLED Power management set at 5V, 500mA.
  
} // setup()



void loop() {
                                           // render the second animation into leds3
                                 
  striscia0();
  striscia1();
  striscia2();
  striscia3();
  striscia4();
  striscia5();
  striscia6();
  striscia7();
  FastLED.show();

  
} // loop()

void striscia0(){
  animationA();                                               // render the first animation into leds2   
  animationB();
  uint8_t ratio = beatsin8(2);
  for (int i = 0; i < NUM_LEDS_PER_STRIP; i++) {                        // mix the 2 arrays together
    leds[0][i] = blend( leds2[i], leds3[i], ratio );
}
}
void striscia1(){
  animationA();                                               // render the first animation into leds2   
  animationB();
  uint8_t ratio = beatsin8(2);
  for (int i = 0; i < NUM_LEDS_PER_STRIP; i++) {                        // mix the 2 arrays together
    leds[1][i] = blend( leds2[i], leds3[i], ratio );
}
}
void striscia2(){
  
  animationA();                                               // render the first animation into leds2   
  animationB();
  uint8_t ratio = beatsin8(2);
  for (int i = 0; i < NUM_LEDS_PER_STRIP; i++) {                        // mix the 2 arrays together
    leds[2][i] = blend( leds2[i], leds3[i], ratio );
}
}
void striscia3(){
  animationA();                                               // render the first animation into leds2   
  animationB();
  uint8_t ratio = beatsin8(2);
  for (int i = 0; i < NUM_LEDS_PER_STRIP; i++) {                        // mix the 2 arrays together
    leds[3][i] = blend( leds2[i], leds3[i], ratio );
}
}
void striscia4(){
  
  animationA();                                               // render the first animation into leds2   
  animationB();
  uint8_t ratio = beatsin8(2);
  for (int i = 0; i < NUM_LEDS_PER_STRIP; i++) {                        // mix the 2 arrays together
    leds[4][i] = blend( leds2[i], leds3[i], ratio );
}
}
void striscia5(){
  animationA();                                               // render the first animation into leds2   
  animationB();
  uint8_t ratio = beatsin8(2);
  for (int i = 0; i < NUM_LEDS_PER_STRIP; i++) {                        // mix the 2 arrays together
    leds[5][i] = blend( leds2[i], leds3[i], ratio );
}
}
void striscia6(){
  
  animationA();                                               // render the first animation into leds2   
  animationB();
  uint8_t ratio = beatsin8(2);
  for (int i = 0; i < NUM_LEDS_PER_STRIP; i++) {                        // mix the 2 arrays together
    leds[6][i] = blend( leds2[i], leds3[i], ratio );
}
}
void striscia7(){
  animationA();                                               // render the first animation into leds2   
  animationB();
  uint8_t ratio = beatsin8(2);
  for (int i = 0; i < NUM_LEDS_PER_STRIP; i++) {                        // mix the 2 arrays together
    leds[7][i] = blend( leds2[i], leds3[i], ratio );
}
}


void animationA() {                                             // running red stripe.

  for (int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
    uint8_t red = (millis() / 10) + (i * 12);                    // speed, length
    if (red > 128) red = 0;
    leds2[i] = CRGB(red, 0, 0);
  }
} // animationA()



void animationB() {                                               // running green stripe in opposite direction.
  for (int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
    uint8_t green = (millis() / 5) - (i * 12);                    // speed, length
    if (green > 128) green = 0;
    leds3[i] = CRGB(0, green, 0);
  }
} // animationB()

non ne vengo fuori

Questo è il codice per una striscia:

#include "FastLED.h"                                          // FastLED library.

#if FASTLED_VERSION < 3001000
#error "Requires FastLED 3.1 or later; check github for latest code."
#endif

#define LED_DT 6                                             // Data pin to connect to the strip.
#define COLOR_ORDER GRB                                       // It's GRB for WS2812 and BGR for APA102.
#define LED_TYPE WS2812                                       // Using APA102, WS2812, WS2801. Don't forget to change LEDS.addLeds.
#define NUM_LEDS_PER_STRIP 20                                           // Number of LED's.

// Global variables can be changed on the fly.
uint8_t max_bright = 128;                                     // Overall brightness definition. It can be changed on the fly.

// have 3 independent CRGBs - 2 for the sources and one for the output
CRGB leds[NUM_LEDS_PER_STRIP];
CRGB leds2[NUM_LEDS_PER_STRIP];
CRGB leds3[NUM_LEDS_PER_STRIP];



void setup() {

  delay(1000);                                                // Power-up safety delay.
  Serial.begin(57600);                                        // Initialize serial port for debugging.

 LEDS.addLeds<LED_TYPE, LED_DT, COLOR_ORDER>(leds, NUM_LEDS_PER_STRIP);  // Use this for WS2812

  FastLED.setBrightness(max_bright);
  set_max_power_in_volts_and_milliamps(5, 500);               // FastLED Power management set at 5V, 500mA.
  
} // setup()

void loop() {

  animationA();                                               // render the first animation into leds2   
  animationB();                                               // render the second animation into leds3

  uint8_t ratio = beatsin8(2);                                // Alternate between 0 and 255 every minute
  
  for (int i = 0; i < NUM_LEDS_PER_STRIP; i++) {                        // mix the 2 arrays together
    leds[i] = blend( leds2[i], leds3[i], ratio );
  }

  FastLED.show();

} // loop()

void animationA() {                                             // running red stripe.
  for (int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
    uint8_t red = (millis() / 10) + (i * 12);                    // speed, length
    if (red > 128) red = 0;
    leds2[i] = CRGB(red, 0, 0);
  }
} // animationA()

void animationB() {                                               // running green stripe in opposite direction.
  for (int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
    uint8_t green = (millis() / 5) - (i * 12);                    // speed, length
    if (green > 128) green = 0;
    leds3[i] = CRGB(0, green, 0);
  }
} // animationB()

Ciao, in un loop :

void loop()
{
programma1();
programma2();
}

Se programma 1 e 2 sono lunghi chiaramente parte sia uno che 2 e quindi si sormontano.
Come posso fare che parta programma1 e dopo TOT secondi (oppure alla fine) parta programma2, facendo in modo che programma1 si arresti e poi a fine di programma2 tutto riparta?

Se metto delay(), chiaramente 1 va a rilento.
La Library looper non mi sembra il mio caso!

Grazie

  1. NON devi mai usare la delay() che, essendo una funzione bloccante, ti ferma l'esecuzione

  2. Devi studiarti come si usa la millis(), prima QUI, poi QUI ed infine leggi anche QUI e QUI

  3. Articolando il programma con l'uso della millis(), come quei tutorial insegnano, potrai schedulare tu le cose secondo le tempistiche che meglio ritieni opportune.

Guglielmo

1 Like

il mio problema è che programma1 o 2 hanno vari cicli all'interno (immagina una striscia led che passi da rosso a blu con un ciclo che incrementa), questo incremento viene effettuato, chiaramente, a ogni ciclo loop.
quindi impostando intervallo 1 in millis(), mi fa girare benissimo il programma1, se metto 1000 va a rilento, perchè me lo fa partire ogni 1000.
Dovrei fare partire programma1, dopo 300 secondi, fermarlo e far partire programma2, dopo 200 secondi, riparte 1

scusate l'intromissione

credo che il problema reale sia che includi delle librerie precompilate...senza aver capito come funzionano.

Prova magari a far lampeggiare 4 o 5 led con sequenze diverse senza usare le librerie usando il millis()

Puso:
credo che il problema reale sia che includi delle librerie precompilate...senza aver capito come funzionano.

... di sicuro, se vuole usarle come dice lui, le deve riscrivere con le temporizzazioni fatte in modo NON bloccante ::slight_smile:

Guglielmo

Il problema è che con i LED nei vari PIN il tutto funziona, ed è semplice!
Per far girare le strisce LED devo per forza andare di librerie.
Proverò a mettere il programma al minimo di complessità e riproverò! :slight_smile:

Mi confermate che l'unica soluzione per temporizzare in modo non bloccante sia usare millis()?

Grazie

Tento di spiegarlo perchè è forse una delle poche cose che credo di aver imparato abbastanza bene.

Il millis parte da quando accendi la scheda.
Gestirlo è come avere dei cronometri in tasca e puoi averne tanti.

Quando decidi TU fai partire uno dei tuoi cronometri e quando il cronometro raggiunge il tempo impostato ad esempio 1 ora decidi un azione da fare sulla 1° stricia di LED.Poi azzera il cronometro.

Nessuno ti vieta di far partire quando ti pare un altro cronometro ne prima ne dopo ne durante che il primo è partito,quindi fai partire il secondo od il terzo od il cinquantesimo cronometro e dopo ad esempio 20 minuti decidi un azione da fare sulla 2° stricia di LED.Poi azzera il cronometro.

Prima o poi lo faccio anchio uno scketch sulle lucine di natale cosi provo di imparare bene gli Array.

Dal mio punto di vista confermo che il delay blocca tutto e quindi è meglio il millis.
Poi CHI LO DICE che per una striscia di led devi per forza usare le librerie??????
Le librerie le usi magari per comodità DOPO che sai come accendere una striscia led.
Sempre dal mio punto di vista.

Ascolto Puso, ricomincio da 0 con i singoli comandi strip.setPixelColor(n,R,G,B) e mi programmo i cicli.

Ciao a tutti.

polipo1970:
Ascolto Puso, ricomincio da 0 con i singoli comandi strip.setPixelColor(n,R,G,B) e mi programmo i cicli.

... sempre con millis() lo devi fare e sempre quei link ti devi studiare ... :smiling_imp:

Guglielmo

Puso:
Poi CHI LO DICE che per una striscia di led devi per forza usare le librerie??????

Lo "dico io" perché sta usando dei led WS2812 che richiedono un ben preciso protocollo e delle ben precise temporizzazioni, tanto per dirne una la parte di codice della libreria che effettua la comunicazione è scritta in assembly perché oltre ad essere molto time critical deve essere altamente efficiente.
Se pensi di essere in grado di scrivere del codice per far accendere anche un solo WS2812, senza usare una libreria, facci vedere come fai. :slight_smile:

gpb01:
... sempre con millis() lo devi fare e sempre quei link ti devi studiare ... :smiling_imp:

Sopratutto non deve usare i vari effetti pronti della FastLed, deve considerare tutti i led come una singola striscia di n led e gestirli singolarmente con le temporizzazioni che desidera.

Ci sono in mezzo anchio in questo mondo come novizio ::slight_smile: ......non dare ascolto a me al massimo posso farti da compagno di banco :kissing: ...io dico solo la mia :roll_eyes: ... a volte giu sto a volte sbagliato. :sunglasses:

tenta di capire...poi tenta di fare(anche se detto da me non ha molto senso...il mio primo prgetto era un semaforo con chiamata pedonale....e ci sto ancora lavorando sù per migliorarlo).
:wink: :smiley: :disappointed_relieved: :fearful:

astrobeed:
Se pensi di essere in grado di scrivere del codice per far accendere anche un solo WS2812, senza usare una libreria, facci vedere come fai. :slight_smile:

OFF-TOPIC

>Astro: sai che su PIC32MX795F512L ci sono riuscito praticamente solo in 'C' (a parte delle "asm volatile ("nop");" per creare i dovuti ritardi senza scomodare nessun Timer) :smiley:

E la mia "libreria" funziona correttamente anche sotto FreeRTOS™ :grin:

FINE OFF-TOPIC

gpb01:
>Astro: sai che su PIC32MX795F512L ci sono riuscito praticamente solo in 'C' (a parte delle "asm volatile ("nop");" per creare i dovuti ritardi senza scomodare nessun Timer) :smiley:

Su i PIC32 hai dei "muscoli" che su i piccoli AVR 8 bit non sono presenti. :smiley:
Pure sulla Teensy 3.x i WS2812 si gestiscono con codice in C puro, non è necessario scomodare l'assembly. :slight_smile:
Diciamo che se mi ci metto d'impegno li gestisco anche su un 328P con codice in C puro, però non vedo perché devo fare tutta questa fatica quando c'è un'ottima libreria pronta all'uso. :slight_smile:

astrobeed:
...
Se pensi di essere in grado di scrivere del codice per far accendere anche un solo WS2812, senza usare una libreria, facci vedere come fai. :slight_smile:

Facile ... prendo uno di questi, metto dei reed al posto dei pulsanti, e poi scrivo il codice per pilotare i reed ... :stuck_out_tongue:

(scusa, non ho resistito :D)