Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



Meteor Rain
 
Share:
Notifications
Clear all

[Solved] Meteor Rain

21 Posts
2 Users
0 Reactions
8,631 Views
 yves
(@yves)
Active Member
Joined: 4 years ago
Posts: 13
Topic starter  

Hello I am trying to add a meteor rain to the 5 point star that I have built.

I have copied the script in arduino and I sav I have the same error message.  I have tried to find my error in the other topics with no success  

Can you help  

The error is in block letter

Thank you for your help

 

Yves


void loop() {
  meteorRain(0xff, 0xff, 0xff, 10, 64, true, 30);
}

void meteorRain(byte red, byte green, byte blue, byte meteorSize, byte meteorTrailDecay, boolean meteorRandomDecay, int SpeedDelay) {
  setAll(0, 0, 0);

  for (int i = 0; i < NUM_LEDS + NUM_LEDS; i++) {

    // fade brightness all LEDs one step
    for (int j = 0; j < NUM_LEDS; j++) {
      if ((!meteorRandomDecay) || (random(10) > 5)) {
        fadeToBlack(j, meteorTrailDecay);
      }
    }

    // draw meteor
    for (int j = 0; j < meteorSize; j++) {
      if ((i - j < NUM_LEDS) && (i - j >= 0)) {
        setPixel(i - j, red, green, blue);
      }
    }

    showStrip();
    delay(SpeedDelay);
  }
}

void fadeToBlack(int ledNo, byte fadeValue) {
  #ifdef ADAFRUIT_NEOPIXEL_H
  // NeoPixel
  uint32_t oldColor;
  uint8_t r, g, b;
  int value;

  oldColor = strip.getPixelColor(ledNo);
  r = (oldColor & 0x00ff0000 UL) >> 16;
  g = (oldColor & 0x0000ff00 UL) >> 8;
  b = (oldColor & 0x000000ff UL);

  r = (r <= 10) ? 0 : (int) r - (r * fadeValue / 256);
  g = (g <= 10) ? 0 : (int) g - (g * fadeValue / 256);
  b = (b <= 10) ? 0 : (int) b - (b * fadeValue / 256);

  strip.setPixelColor(ledNo, r, g, b);
  #endif
  #ifndef ADAFRUIT_NEOPIXEL_H
  // FastLED
  leds[ledNo].fadeToBlackBy(fadeValue);
  #endif
}

   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2785
 

Hi Yves,

Welcome to the forum!

Can you post the error message?


   
ReplyQuote
 yves
(@yves)
Active Member
Joined: 4 years ago
Posts: 13
Topic starter  

The error message is 

 

setAll(0,0,0);


   
ReplyQuote
 yves
(@yves)
Active Member
Joined: 4 years ago
Posts: 13
Topic starter  

The error message is setAll(0,0,0);  What do we have to configure to avoid this message  

Thanks


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2785
 

Hy Yves,

it would have been more helpful if you'd posted the full code and the full error message.

My best guess is that you're missing these functions;

void showStrip() {
 #ifdef ADAFRUIT_NEOPIXEL_H
   // NeoPixel
   strip.show();
 #endif
 #ifndef ADAFRUIT_NEOPIXEL_H
   // FastLED
   FastLED.show();
 #endif
}

void setPixel(int Pixel, byte red, byte green, byte blue) {
 #ifdef ADAFRUIT_NEOPIXEL_H
   // NeoPixel
   strip.setPixelColor(Pixel, strip.Color(red, green, blue));
 #endif
 #ifndef ADAFRUIT_NEOPIXEL_H
   // FastLED
   leds[Pixel].r = red;
   leds[Pixel].g = green;
   leds[Pixel].b = blue;
 #endif
}

void setAll(byte red, byte green, byte blue) {
  for(int i = 0; i < NUM_LEDS; i++ ) {
    setPixel(i, red, green, blue);
  }
  showStrip();
}

 But since I cannot see if you pasted the header as well, you may be missing this part (on top) as well.

I assume you copied the effect from the LED Effects article (link), where it shows in the beginning of the article, that you need to take the base framework code and replace the red marked (below - or yellow marked in the article) with the code of the effect.

You may have missed/overlooked that part 😊  (happens to the best of us).

#include "FastLED.h"
#define NUM_LEDS 60
CRGB leds[NUM_LEDS];
#define PIN 6

void setup()
{
  FastLED.addLeds < WS2811, PIN, GRB > (leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
}

//  REPLACE FROM HERE 
void loop() {
  // ---> here we call the effect function <---
}

// ---> here we define the effect function <---
//  REPLACE TO HERE 

void showStrip() {
 #ifdef ADAFRUIT_NEOPIXEL_H
   // NeoPixel
   strip.show();
 #endif
 #ifndef ADAFRUIT_NEOPIXEL_H
   // FastLED
   FastLED.show();
 #endif
}

void setPixel(int Pixel, byte red, byte green, byte blue) {
 #ifdef ADAFRUIT_NEOPIXEL_H
   // NeoPixel
   strip.setPixelColor(Pixel, strip.Color(red, green, blue));
 #endif
 #ifndef ADAFRUIT_NEOPIXEL_H
   // FastLED
   leds[Pixel].r = red;
   leds[Pixel].g = green;
   leds[Pixel].b = blue;
 #endif
}

void setAll(byte red, byte green, byte blue) {
  for(int i = 0; i < NUM_LEDS; i++ ) {
    setPixel(i, red, green, blue);
  }
  showStrip();
}

 

So you full code should look like this

#include "FastLED.h"
#define NUM_LEDS 60
CRGB leds[NUM_LEDS];
#define PIN 6

void setup()
{
  FastLED.addLeds < WS2811, PIN, GRB > (leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
}

void loop() {
  meteorRain(0xff, 0xff, 0xff, 10, 64, true, 30);
}

void meteorRain(byte red, byte green, byte blue, byte meteorSize, byte meteorTrailDecay, boolean meteorRandomDecay, int SpeedDelay) {
  setAll(0, 0, 0);

  for (int i = 0; i < NUM_LEDS + NUM_LEDS; i++) {

    // fade brightness all LEDs one step
    for (int j = 0; j < NUM_LEDS; j++) {
      if ((!meteorRandomDecay) || (random(10) > 5)) {
        fadeToBlack(j, meteorTrailDecay);
      }
    }

    // draw meteor
    for (int j = 0; j < meteorSize; j++) {
      if ((i - j < NUM_LEDS) && (i - j >= 0)) {
        setPixel(i - j, red, green, blue);
      }
    }

    showStrip();
    delay(SpeedDelay);
  }
}

void fadeToBlack(int ledNo, byte fadeValue) {
  #ifdef ADAFRUIT_NEOPIXEL_H
  // NeoPixel
  uint32_t oldColor;
  uint8_t r, g, b;
  int value;

  oldColor = strip.getPixelColor(ledNo);
  r = (oldColor & 0x00ff0000 UL) >> 16;
  g = (oldColor & 0x0000ff00 UL) >> 8;
  b = (oldColor & 0x000000ff UL);

  r = (r <= 10) ? 0 : (int) r - (r * fadeValue / 256);
  g = (g <= 10) ? 0 : (int) g - (g * fadeValue / 256);
  b = (b <= 10) ? 0 : (int) b - (b * fadeValue / 256);

  strip.setPixelColor(ledNo, r, g, b);
  #endif
  #ifndef ADAFRUIT_NEOPIXEL_H
  // FastLED
  leds[ledNo].fadeToBlackBy(fadeValue);
  #endif
}

void showStrip() {
 #ifdef ADAFRUIT_NEOPIXEL_H
   // NeoPixel
   strip.show();
 #endif
 #ifndef ADAFRUIT_NEOPIXEL_H
   // FastLED
   FastLED.show();
 #endif
}

void setPixel(int Pixel, byte red, byte green, byte blue) {
 #ifdef ADAFRUIT_NEOPIXEL_H
   // NeoPixel
   strip.setPixelColor(Pixel, strip.Color(red, green, blue));
 #endif
 #ifndef ADAFRUIT_NEOPIXEL_H
   // FastLED
   leds[Pixel].r = red;
   leds[Pixel].g = green;
   leds[Pixel].b = blue;
 #endif
}

void setAll(byte red, byte green, byte blue) {
  for(int i = 0; i < NUM_LEDS; i++ ) {
    setPixel(i, red, green, blue);
  }
  showStrip();
}

 

I hope this helps ... don't forget to set the values for "NUM_LEDS" and "PIN". 😉 


   
ReplyQuote
 yves
(@yves)
Active Member
Joined: 4 years ago
Posts: 13
Topic starter  

@hans

Thank you for your support

 

Yves


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2785
 

Did it work? 😊 


   
ReplyQuote
 yves
(@yves)
Active Member
Joined: 4 years ago
Posts: 13
Topic starter  

@hans

Yves Gagnon,

 

Is it possible to modify the script to have 3 meteor rain at a 5 second interval.

The lenght are 60cm, 90cm and 120cm.

Thanks for your support

#include "FastLED.h"
#define NUM_LEDS 60
CRGB leds[NUM_LEDS];
#define PIN 6

void setup()
{
  FastLED.addLeds < WS2811, PIN, GRB > (leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
}

void loop() {
  meteorRain(0xff, 0xff, 0xff, 10, 64, true, 30);
}

void meteorRain(byte red, byte green, byte blue, byte meteorSize, byte meteorTrailDecay, boolean meteorRandomDecay, int SpeedDelay) {
  setAll(0, 0, 0);

  for (int i = 0; i < NUM_LEDS + NUM_LEDS; i++) {

    // fade brightness all LEDs one step
    for (int j = 0; j < NUM_LEDS; j++) {
      if ((!meteorRandomDecay) || (random(10) > 5)) {
        fadeToBlack(j, meteorTrailDecay);
      }
    }

    // draw meteor
    for (int j = 0; j < meteorSize; j++) {
      if ((i - j < NUM_LEDS) && (i - j >= 0)) {
        setPixel(i - j, red, green, blue);
      }
    }

    showStrip();
    delay(SpeedDelay);
  }
}

void fadeToBlack(int ledNo, byte fadeValue) {
  #ifdef ADAFRUIT_NEOPIXEL_H
  // NeoPixel
  uint32_t oldColor;
  uint8_t r, g, b;
  int value;

  oldColor = strip.getPixelColor(ledNo);
  r = (oldColor & 0x00ff0000 UL) >> 16;
  g = (oldColor & 0x0000ff00 UL) >> 8;
  b = (oldColor & 0x000000ff UL);

  r = (r <= 10) ? 0 : (int) r - (r * fadeValue / 256);
  g = (g <= 10) ? 0 : (int) g - (g * fadeValue / 256);
  b = (b <= 10) ? 0 : (int) b - (b * fadeValue / 256);

  strip.setPixelColor(ledNo, r, g, b);
  #endif
  #ifndef ADAFRUIT_NEOPIXEL_H
  // FastLED
  leds[ledNo].fadeToBlackBy(fadeValue);
  #endif
}

void showStrip() {
 #ifdef ADAFRUIT_NEOPIXEL_H
   // NeoPixel
   strip.show();
 #endif
 #ifndef ADAFRUIT_NEOPIXEL_H
   // FastLED
   FastLED.show();
 #endif
}

void setPixel(int Pixel, byte red, byte green, byte blue) {
 #ifdef ADAFRUIT_NEOPIXEL_H
   // NeoPixel
   strip.setPixelColor(Pixel, strip.Color(red, green, blue));
 #endif
 #ifndef ADAFRUIT_NEOPIXEL_H
   // FastLED
   leds[Pixel].r = red;
   leds[Pixel].g = green;
   leds[Pixel].b = blue;
 #endif
}

void setAll(byte red, byte green, byte blue) {
  for(int i = 0; i < NUM_LEDS; i++ ) {
    setPixel(i, red, green, blue);
  }
  showStrip();
}

 

 


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2785
 

Hi Yves,

Yes, you can control 3 strips, and yes you can run meteor rain on each independently.
FastLED is capable of controlling more than one strip (one pin per strip).
I'd start with something like this:

(note: I do not know the pixel density of your LED strips, so I have no idea how many LEDs you 60cm would have)

#include "FastLED.h"

#define STRIP1_NUM_LEDS 60 // correct for the actual LED counts of the strips
#define STRIP2_NUM_LEDS 90
#define STRIP3_NUM_LEDS 120

CRGB leds1[STRIP1_NUM_LEDS];
CRGB leds2[STRIP2_NUM_LEDS];
CRGB leds3[STRIP2_NUM_LEDS];

#define STRIP1_PIN 6 // modify these to the pins you actually use
#define STRIP2_PIN 7
#define STRIP3_PIN 8

void setup()
{
  FastLED.addLeds < WS2811, STRIP1_PIN, GRB > (leds1, STRIP1_NUM_LEDS).setCorrection( TypicalLEDStrip );
  FastLED.addLeds < WS2811, STRIP2_PIN, GRB > (leds2, STRIP2_NUM_LEDS).setCorrection( TypicalLEDStrip );
  FastLED.addLeds < WS2811, STRIP3_PIN, GRB > (leds3, STRIP3_NUM_LEDS).setCorrection( TypicalLEDStrip );
}

We do however need to change the meteorRain() function to handle all 3 strips. Since I do not have 3 strips to test with, here a guess of what that could look like:

Again: untested code, and the strips will run out of sync eventually, and I haven't had enough coffee yet this morning 😉 .
If you'd like to have them run in sync (end at the same time) or run identical (we'd need to scale), then a few other modifications may be needed.
This should get you started though. 

Keep in mind: for the effect to display on all 3 strips, you'd need to do each step of the effect, one strip at a time.

#include "FastLED.h"

#define STRIP1_NUM_LEDS 60 // correct for the actual LED counts of the strips
#define STRIP2_NUM_LEDS 90
#define STRIP3_NUM_LEDS 120

CRGB leds1[STRIP1_NUM_LEDS];
CRGB leds2[STRIP2_NUM_LEDS];
CRGB leds3[STRIP2_NUM_LEDS];

#define STRIP1_PIN 6 // modify these to the pins you actually use
#define STRIP2_PIN 7
#define STRIP3_PIN 8

int Strip1Position = 0;
int Strip2Position = 0;
int Strip3Position = 0;

void setup()
{
  FastLED.addLeds < WS2811, STRIP1_PIN, GRB > (leds1, STRIP1_NUM_LEDS).setCorrection( TypicalLEDStrip );
  FastLED.addLeds < WS2811, STRIP2_PIN, GRB > (leds2, STRIP2_NUM_LEDS).setCorrection( TypicalLEDStrip );
  FastLED.addLeds < WS2811, STRIP3_PIN, GRB > (leds3, STRIP3_NUM_LEDS).setCorrection( TypicalLEDStrip );
}

void loop() {
  meteorRain(0xff, 0xff, 0xff, 10, 64, true, 30);
}
 
void meteorRain(byte red, byte green, byte blue, byte meteorSize, byte meteorTrailDecay, boolean meteorRandomDecay, int SpeedDelay) {  
  if (Strip1Position==0) { fill_solid( leds1, STRIP1_NUM_LEDS, CRGB(0,0,0)); }
  if (Strip2Position==0) { fill_solid( leds2, STRIP2_NUM_LEDS, CRGB(0,0,0)); }
  if (Strip3Position==0) { fill_solid( leds3, STRIP3_NUM_LEDS, CRGB(0,0,0)); }
  
  // fade brightness all LEDs one step
  for(int j=0; j<STRIP1_NUM_LEDS; j++) {
    if( (!meteorRandomDecay) || (random(10)>5) ) {
      leds1[j].fadeToBlackBy(meteorTrailDecay); 
    }
  }
  
  for(int j=0; j<STRIP2_NUM_LEDS; j++) {
    if( (!meteorRandomDecay) || (random(10)>5) ) {
      leds2[j].fadeToBlackBy(meteorTrailDecay); 
    }
  }
  
  for(int j=0; j<STRIP3_NUM_LEDS; j++) {
    if( (!meteorRandomDecay) || (random(10)>5) ) {
      leds3[j].fadeToBlackBy(meteorTrailDecay); 
    }
  }
   
  // draw meteor
  for(int j = 0; j < meteorSize; j++) {
    if( ( i-j <STRIP1_NUM_LEDS) && (i-j>=0) ) {
      leds1[i-j] = CRGB(red, green, blue);
    }
  }
   
  for(int j = 0; j < meteorSize; j++) {
    if( ( i-j <STRIP2_NUM_LEDS) && (i-j>=0) ) {
      leds2[i-j] = CRGB(red, green, blue);
    }
  }

  for(int j = 0; j < meteorSize; j++) {
    if( ( i-j <STRIP3_NUM_LEDS) && (i-j>=0) ) {
      leds3[i-j] = CRGB(red, green, blue);
    }
  }
  
  FastLED.show();
  delay(SpeedDelay);
  
  if(Strip1Position<STRIP1_NUM_LEDS+STRIP1_NUM_LEDS) {
    Strip1Position++; 
  }
  else
  {
    Strip1Postion = 0;
  }
  
  if(Strip2Position<STRIP2_NUM_LEDS+STRIP2_NUM_LEDS) {
    Strip2Position++; 
  }
  else
  {
    Strip2Position = 0;
  }
  
  if(Strip3Position<STRIP3_NUM_LEDS+STRIP3_NUM_LEDS) {
    Strip3Position++; 
  }
  else
  {
    Strip3Position = 0;
  }
}

   
ReplyQuote
 yves
(@yves)
Active Member
Joined: 4 years ago
Posts: 13
Topic starter  

@hans

I have tried to fix the CApTCHA with no success.  This is a another computor.

 

I have modified certain lines to reflect the ws2812 and the pin number.

I have an error on line 52.  I have compare other code with no success,  Why is it stopping at this line when all the others are the same at the exception of the strip number.

 

#include <FastLED.h>

#define STRIP1_NUM_LEDS 36 // 18 LED/feet or 30cm. correct for the actual LED counts of the strips.  60 MA //                                     /LED
#define STRIP2_NUM_LEDS 48
#define STRIP3_NUM_LEDS 72

//CRGB leds1[STRIP1_NUM_LEDS];
//CRGB leds2[STRIP2_NUM_LEDS];
//CRGB leds3[STRIP3_NUM_LEDS];

#define STRIP1_PIN 6
#define STRIP2_PIN 7
#define STRIP3_PIN 8

int Strip1Position = 0;
int Strip2Position = 0; // GRB ordering is assumed
int Strip3Position = 0;

//void setup() // void setup is already preiously noted
//{ // void setup is already preiously noted
FastLED.addLeds < WS2812, STRIP1_PIN, GRB > (leds1, STRIP1_NUM_LEDS).setCorrection( TypicalLEDStrip );
FastLED.addLeds < WS2812, STRIP2_PIN, GRB > (leds2, STRIP2_NUM_LEDS).setCorrection( TypicalLEDStrip );
FastLED.addLeds < WS2812, STRIP3_PIN, GRB > (leds3, STRIP3_NUM_LEDS).setCorrection( TypicalLEDStrip );
}

void loop() {
meteorRain(0xff, 0xff, 0xff, 10, 64, true, 30);
}

void meteorRain(byte red, byte green, byte blue, byte meteorSize, byte meteorTrailDecay, boolean meteorRandomDecay, int SpeedDelay) {
if (Strip1Position==0) { fill_solid( leds1, STRIP1_NUM_LEDS, CRGB(0,0,0)); }
if (Strip2Position==0) { fill_solid( leds2, STRIP2_NUM_LEDS, CRGB(0,0,0)); }
if (Strip3Position==0) { fill_solid( leds3, STRIP3_NUM_LEDS, CRGB(0,0,0)); }

// fade brightness all LEDs one step
for(int j=0; j<STRIP1_NUM_LEDS; j++) {
if( (!meteorRandomDecay) || (random(10)>5) ) {
leds1[j].fadeToBlackBy(meteorTrailDecay);
}
}

for(int j=0; j<STRIP2_NUM_LEDS; j++) {
if( (!meteorRandomDecay) || (random(10)>5) ) {
leds2[j].fadeToBlackBy(meteorTrailDecay);
}
}

for(int j=0; j<STRIP3_NUM_LEDS; j++) {
if( (!meteorRandomDecay) || (random(10)>5) ) {
leds3[j].fadeToBlackBy(meteorTrailDecay);
}
}

// draw meteor
for(int j = 0; j < meteorSize; j++) {
if( ( i-j <STRIP1_NUM_LEDS) && (i-j>=0) ) {
leds1[i-j] = CRGB(red, green, blue);
}
}

for(int j = 0; j < meteorSize; j++) {
if( ( i-j <STRIP2_NUM_LEDS) && (i-j>=0) ) {
leds2[i-j] = CRGB(red, green, blue);
}
}

for(int j = 0; j < meteorSize; j++) {
if( ( i-j <STRIP3_NUM_LEDS) && (i-j>=0) ) {
leds3[i-j] = CRGB(red, green, blue);
}
}

FastLED.show();
delay(SpeedDelay);

if(Strip1Position<STRIP1_NUM_LEDS+STRIP1_NUM_LEDS) {
Strip1Position++;
}
else
{
Strip1Postion = 0;
}

if(Strip2Position<STRIP2_NUM_LEDS+STRIP2_NUM_LEDS) {
Strip2Position++;
}
else
{
Strip2Position = 0;
}

if(Strip3Position<STRIP3_NUM_LEDS+STRIP3_NUM_LEDS) {
Strip3Position++;
}
else
{
Strip3Position = 0;
}
}

Thanks for your support.

 

Yves


   
ReplyQuote
 yves
(@yves)
Active Member
Joined: 4 years ago
Posts: 13
Topic starter  

At the botom of the screen it is marked

'FASTLED'does not name a type


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2785
 

There are quite a few issues with the code, probably because you were trying to find the issue.

1) You commented out the "leds1", "leds2", etc definition

2) The "void setup()" line was commented out

3) You did not, or not entirely, copy the suggested code

After correcting those point, this compiles just fine - hope this helps 😊 

#include <FastLED.h>

#define STRIP1_NUM_LEDS 36 
#define STRIP2_NUM_LEDS 48
#define STRIP3_NUM_LEDS 72

CRGB leds1[STRIP1_NUM_LEDS];
CRGB leds2[STRIP2_NUM_LEDS];
CRGB leds3[STRIP3_NUM_LEDS];

#define STRIP1_PIN 6
#define STRIP2_PIN 7
#define STRIP3_PIN 8

int Strip1Position = 0;
int Strip2Position = 0; // GRB ordering is assumed
int Strip3Position = 0;

void setup() // void setup is already preiously noted
{ // void setup is already preiously noted
  FastLED.addLeds < WS2812, STRIP1_PIN, GRB > (leds1, STRIP1_NUM_LEDS).setCorrection(TypicalLEDStrip);
  FastLED.addLeds < WS2812, STRIP2_PIN, GRB > (leds2, STRIP2_NUM_LEDS).setCorrection(TypicalLEDStrip);
  FastLED.addLeds < WS2812, STRIP3_PIN, GRB > (leds3, STRIP3_NUM_LEDS).setCorrection(TypicalLEDStrip);
}

void loop() {
  meteorRain(0xff, 0xff, 0xff, 10, 64, true, 30);
}

void meteorRain(byte red, byte green, byte blue, byte meteorSize, byte meteorTrailDecay, boolean meteorRandomDecay, int SpeedDelay) {
  if (Strip1Position == 0) {
    fill_solid(leds1, STRIP1_NUM_LEDS, CRGB(0, 0, 0));
  }
  if (Strip2Position == 0) {
    fill_solid(leds2, STRIP2_NUM_LEDS, CRGB(0, 0, 0));
  }
  if (Strip3Position == 0) {
    fill_solid(leds3, STRIP3_NUM_LEDS, CRGB(0, 0, 0));
  }

  // fade brightness all LEDs one step
  for (int j = 0; j < STRIP1_NUM_LEDS; j++) {
    if ((!meteorRandomDecay) || (random(10) > 5)) {
      leds1[j].fadeToBlackBy(meteorTrailDecay);
    }
  }

  for (int j = 0; j < STRIP2_NUM_LEDS; j++) {
    if ((!meteorRandomDecay) || (random(10) > 5)) {
      leds2[j].fadeToBlackBy(meteorTrailDecay);
    }
  }

  for (int j = 0; j < STRIP3_NUM_LEDS; j++) {
    if ((!meteorRandomDecay) || (random(10) > 5)) {
      leds3[j].fadeToBlackBy(meteorTrailDecay);
    }
  }

  // draw meteor
  for (int j = 0; j < meteorSize; j++) {
    if ((Strip1Position - j < STRIP1_NUM_LEDS) && (Strip1Position - j >= 0)) {
      leds1[Strip1Position - j] = CRGB(red, green, blue);
    }
  }

  for (int j = 0; j < meteorSize; j++) {
    if ((Strip2Position - j < STRIP2_NUM_LEDS) && (Strip2Position - j >= 0)) {
      leds2[Strip2Position - j] = CRGB(red, green, blue);
    }
  }

  for (int j = 0; j < meteorSize; j++) {
    if ((Strip3Position - j < STRIP3_NUM_LEDS) && (Strip3Position - j >= 0)) {
      leds3[Strip3Position - j] = CRGB(red, green, blue);
    }
  }

  FastLED.show();
  delay(SpeedDelay);

  if (Strip1Position < STRIP1_NUM_LEDS + STRIP1_NUM_LEDS) {
    Strip1Position++;
  } else {
    Strip1Position = 0;
  }

  if (Strip2Position < STRIP2_NUM_LEDS + STRIP2_NUM_LEDS) {
    Strip2Position++;
  } else {
    Strip2Position = 0;
  }

  if (Strip3Position < STRIP3_NUM_LEDS + STRIP3_NUM_LEDS) {
    Strip3Position++;
  } else {
    Strip3Position = 0;
  }
}

   
ReplyQuote
 yves
(@yves)
Active Member
Joined: 4 years ago
Posts: 13
Topic starter  

Many thanks, it work perfectly

 

Yves


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2785
 

Cool! 😊  Glad to hear that! 👍 


   
ReplyQuote
 yves
(@yves)
Active Member
Joined: 4 years ago
Posts: 13
Topic starter  

Good day Hans

A few weeks ago, you have made the meteor rain work  and it worked.

I, today I have tried to modify the sript with no succes.

I have verified various forum with no succes.  I sent the script (via email) to my brother and t works on his computor. 

Can you help

Yves

 

The error message that I have is as follo:

----------------------------------------

...Programmer Type : butterfly
Description : Atmel AppNote AVR109 Boot Loader

Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding

avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = "F"; type = @
Software Version = Q.w; Hardware Version = �.
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: leave prog mode
le port série sélectionné de
n'existe pas ou votre Arduino n'est pas connecté
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: exit bootloader

avrdude done. Thank you.

---------------------------------


   
ReplyQuote
Page 1 / 2
Share: