Hi
could some kindle one let me know how I could run Marks Fire2012
from the opposite end of of the strip please.
tried changing the following
for( int= 0; i< NUM_LEDS: i++) {
to
for(int i=50; i>NUM_LEDS:i–){ //50 as I have 50 LEDs
this didn’t work.
JP_Roy
(JP Roy)
November 18, 2017, 6:44pm
2
Try… for(int i = NUM_LEDS 1, i=<0, i- )
JP_Roy
(JP Roy)
November 18, 2017, 6:46pm
3
ooops… reedit to… for ( int i = NUM_LEDS - 1 , i >= 0 , i - - )
JP_Roy
(JP Roy)
November 18, 2017, 6:51pm
4
Damn it… for ( int i = NUM_LEDS - 1 ; i >= 0 ; i - - )
Hi JP Roy
just tried it is still working from the same end.
JP_Roy
(JP Roy)
November 18, 2017, 7:08pm
6
There are more than just one place where you need to apply the same reversed loop
marmil
(Marc Miller)
November 18, 2017, 7:11pm
7
Did you see this in the code?
bool gReverseDirection = false;
sorry, no I have not seen that code. any example would be much appreciated
Check my Rings of Saturn code on Github (username: modustrialmaker). you’ll have to look through a bunch of functions, but it has a couple examples of Fire coming from both ends in it (searching for “fire” should locate them pretty quickly in the code).
Ken_White
(Ken White)
November 20, 2017, 2:52am
10
@Chithru_Mihiripenna - as @marmil said: look at line 11 in:
#include <FastLED.h>
#define LED_PIN 5
#define COLOR_ORDER GRB
#define CHIPSET WS2811
#define NUM_LEDS 30
#define BRIGHTNESS 200
#define FRAMES_PER_SECOND 60
bool gReverseDirection = false;
CRGB leds[NUM_LEDS];
// Fire2012 with programmable Color Palette
//
// This code is the same fire simulation as the original "Fire2012",
// but each heat cell's temperature is translated to color through a FastLED
// programmable color palette, instead of through the "HeatColor(...)" function.
//
This file has been truncated. show original
and change false to true. This should change the direction of the fire on the strip to the other end.