Notifications
Clear all

Theatre chase in opposite directions.

155 Posts
6 Users
2 Reactions
12.2 K Views
Davy PS
(@davy-ps)
Member
Joined: 2 years ago
Posts: 74
Topic starter  

Hi Guys,

             The effect I am after is on this video at the 6-40 mark. Where the opposing theatre chase LEDs are different colours.

Cheers,

Davy.


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2043
 

   
ReplyQuote
Davy PS
(@davy-ps)
Member
Joined: 2 years ago
Posts: 74
Topic starter  

@robotbuilder 

Hi Mate,

            Got following error message.

image

 

Davy.


   
ReplyQuote
Davy PS
(@davy-ps)
Member
Joined: 2 years ago
Posts: 74
Topic starter  

@robotbuilder 

Mate,

         I had another look at sketch and noticed in the Integer that "pattern" was singular and in the void loop it was plural. I removed the 's' in the void loop and the compiler downloaded, however, apart from the first LED lighting up Blue and staying on, nothing else happened. I then made "pattern" plural in each case but same result.

 

Davy.


   
ReplyQuote
Davy PS
(@davy-ps)
Member
Joined: 2 years ago
Posts: 74
Topic starter  

Hi Guys. Regarding a previous issue with delay {which was part of a massive sketch} I have isolated the offending loop and put it in a smaller sketch. For some reason when it gets to LED[3]the delay doesn't activate and the LED stays HIGH. This continues for next 6 LEDS.

Any ideas?

Cheers,

Davy.

 

[code]
#include <Adafruit_NeoPixel.h>
#include <FastLED.h>

#define LED_PIN 4
#define NUM_LEDS 10
CRGB leds[NUM_LEDS];
uint8_t hue = 0;

void setup() {
// Setup Serial Monitor
Serial.begin(9600);

FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
FastLED.setBrightness(250);
}
void loop() {
leds[0] = CRGB(0,255,0); //Red LED
FastLED.show();
delay(1000);
leds[0] = CRGB(0, 0, 0); //Red LED
FastLED.show();
delay(1000);

leds[1] = CRGB(255,0,0); //Red LED
FastLED.show();
delay(1000);
leds[1] = CRGB(0, 0, 0); //Green LED
FastLED.show();
delay(1000);

leds[2] = CRGB(0,0, 255); //Blue LED
FastLED.show();
delay(1000);
leds[2] = CRGB(0, 0, 0); //Blue LED
FastLED.show();
delay(1000);

leds[3] = CRGB(0, 255, 0); //Yellow LED
FastLED.show();
delay(1000);
leds[3] = CRGB(0, 0, 0); //Yellow LED
delay(1000);

leds[4] = CRGB(255, 255, 0); //Yellow LED
FastLED.show();
delay(1000);
leds[4] = CRGB(0, 0, 0); //Yellow LED
delay(1000);

leds[5] = CRGB(25, 55, 0); //Yellow LED
FastLED.show();
delay(1000);
leds[5] = CRGB(0, 0, 0); //Yellow LED
delay(1000);

leds[6] = CRGB(105, 25, 0); //Yellow LED
FastLED.show();
delay(1000);
leds[6] = CRGB(0, 0, 0); //Yellow LED
delay(1000);

leds[7] = CRGB(0, 95, 150); //Yellow LED
FastLED.show();
delay(1000);
leds[7] = CRGB(0, 0, 0); //Yellow LED
delay(1000);

leds[8] = CRGB(255, 0, 200); //Yellow LED
FastLED.show();
delay(1000);
leds[8] = CRGB(0, 0, 0); //Yellow LED
delay(1000);

leds[9] = CRGB(255, 0, 200); //Yellow LED
FastLED.show();
delay(1000);
leds[9] = CRGB(0, 0, 0); //Yellow LED
delay(1000);
}
[/code]


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2043
 

   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2043
 

@davy-ps 

It is midnight so I will have to check your code tomorrow.

You can make your code nicer if you are using the Arduino IDE.

In the IDE click text with right mouse button and Select All and save as HTML

In your post make a few CRLF with the enter key where you want to insert the code.

Select the {;} in the top bar of your post.

Insert between CRLF control codes.

 


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2537
 
Posted by: @davy-ps

Hi Guys,

             The effect I am after is on this video at the 6-40 mark. Where the opposing theatre chase LEDs are different colours.

This appears to be a different effect, it's difficult to see because of the speed but it appears that the effect is taking place with specific colours of LEDs. That is, the LED is always the same colour regardless of which way the "wave" is passing. So the whole effect is to send a pulse from each end to the other end and back over a series of pre-coloured LEDs.

Is that correct ?

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2537
 
Posted by: @davy-ps

Hi Guys. Regarding a previous issue with delay {which was part of a massive sketch} I have isolated the offending loop and put it in a smaller sketch. For some reason when it gets to LED[3]the delay doesn't activate and the LED stays HIGH. This continues for next 6 LEDS.

Any ideas?

It would be very difficult to study this problem in depth because it doesn't seem to be a problem with the code. That suggests that it's being caused by your LEDs, Arduino, wiring or something that we can't access for testing.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2537
 
Posted by: @davy-ps

Hi Guys,

             The effect I am after is on this video at the 6-40 mark. Where the opposing theatre chase LEDs are different colours.

Try this ...

 

 

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2537
 
Posted by: @davy-ps

Hi Guys. Regarding a previous issue with delay {which was part of a massive sketch} I have isolated the offending loop and put it in a smaller sketch. For some reason when it gets to LED[3]the delay doesn't activate and the LED stays HIGH. This continues for next 6 LEDS.

Any ideas?

Upon careful re-reading,it appears that you are failing to call FastLED.show() to re-light the changed set of LEDs.

If you look at the code for LED[3], it pauses but never displays because there is no call to FastLED.show().

Try adding in the missing calls and see if it heals itself 🙂

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Davy PS
(@davy-ps)
Member
Joined: 2 years ago
Posts: 74
Topic starter  

@will HaHa. I rewrote the sketch and it worked before I got your reply. I went over the original a few times and never noticed the second FastLed command was missing. Once I can accept but seven times!!!!!!!!!!

Original is now working too.

Call me cloth eyes.

;-}


   
ReplyQuote
Davy PS
(@davy-ps)
Member
Joined: 2 years ago
Posts: 74
Topic starter  

@robotbuilder Hi Mate. Had to Google CRLF. All double Dutch to me. 😉 . Regarding the new code you sent, it compiles but doesn't run. The third LED  (IE LED 2) comes on and stays HIGH but nothing else happens.

 

Cheers,

 

Davy.


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2043
 

   
ReplyQuote
Davy PS
(@davy-ps)
Member
Joined: 2 years ago
Posts: 74
Topic starter  

@robotbuilder Hi Mate. You have done what I done and haven't added FastLed.show() in between clear and delay from LED 3 onward.

 

😉


   
ReplyQuote
Page 3 / 11