Giter Site home page Giter Site logo

fastled-demos's People

Contributors

atuline avatar davidbrai avatar lpmi-13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fastled-demos's Issues

irtest - which controller did you use?

Hi,

I was looking around and i saw the more ppl had the same issue as i - Arduino interrupts are collided with the IR remote - did you used teensy here? or you has a successful run with Arduino?

Lightnings non blocking

I cannot seem to get this animation to run using millis() instead of delays. Obviously a beginner.

pop

I think, that is not a perfect logic:
if (ranamount >NUM_LEDS) ranamount = NUM_LEDS; // Make sure we're at least utilizing ALL the LED's.
int idex = random16(0, ranamount);

if (idex < NUM_LEDS) {        

I have 180 LEDs. If ranamount is set to 50, I will see only a portion.
From my perspective the idea of the parameter ranamount got a bit lost.

if you want idex < NUM_LEDS, why did´nt you call int idex = random16(0, ranamount -1);
or if the idea of ranamount got lost: int idex = random16(0, NUM_LEDS -1);

Auto Mode Cycle

hello sir,
I need a Function to run all the effects one by one. Like auto mode cycle function.

inoise8_fire.ino is not compiling.

inoise8_fire.ino is not compiling,

Arduino: 1.8.9 (Windows 10), Board: "LOLIN(WEMOS) D1 mini Pro, 160 MHz, Flash, Disabled, 16M (15M SPIFFS), v2 Higher Bandwidth, Disabled, None, Only Sketch, 921600"

                 ^

sketch_apr04a:24:9: error: 'uint8_t index' redeclared as different kind of symbol

uint8_t index = 0;

     ^

In file included from C:\Users\HP\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0/tools/sdk/libc/xtensa-lx106-elf/include/stdlib.h:11:0,

             from C:\Users\HP\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/Arduino.h:27,

             from C:\Users\HP\AppData\Local\Temp\arduino_build_526611\sketch\sketch_apr04a.ino.cpp:1:

C:\Users\HP\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0/tools/sdk/libc/xtensa-lx106-elf/include/string.h:54:15: error: previous declaration of 'char* index(const char*, int)'

char *_EXFUN(index,(const char *, int));

           ^

C:\Users\HP\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0/tools/sdk/libc/xtensa-lx106-elf/include/_ansi.h:65:30: note: in definition of macro '_EXFUN'

#define _EXFUN(name, proto) name proto

                          ^

C:\Users\HP\Documents\Arduino\sketch_apr04a\sketch_apr04a.ino: In function 'void inoise8_fire()':

sketch_apr04a:61:11: error: assignment of function 'char* index(const char*, int)'

 index = inoise8(i*xscale,millis()*yscale*NUM_LEDS/255);                                           // X location is constant, but we move along the Y at the rate of millis()

       ^

sketch_apr04a:61:11: error: cannot convert 'uint8_t {aka unsigned char}' to 'char*(const char*, int)' in assignment

sketch_apr04a:62:60: error: invalid operands of types 'int' and 'char*(const char*, int)' to binary 'operator*'

 leds[i] = ColorFromPalette(currentPalette, min(i*(index)>>6, 255), i*255/NUM_LEDS, LINEARBLEND);  // With that value, look up the 8 bit colour palette value and assign it to the current LED.

                                                        ^

Using library FastLED at version 3.2.6 in folder: C:\Users\HP\Documents\Arduino\libraries\FastLED
exit status 1
'uint8_t index' redeclared as different kind of sym

bol

Multiple Strips

I've gotten this to work well enough on a single strip; however, I have 4 led strips in my room, one on each border wall of the ceiling. I tried adding all strips to a single LED array, but for some reason that didn't work.

Is there any way to make multiple strips on multiple pins work?

Adding two libraries

Please tell me.
Can we merge a program of fast led and adafruit neo pixal in one single program. I try but lost of errors occur. sir can u give me any example.

Easing Demo doesn't work correctly with higher count of LEDs

The easing demo works fine with the pre-set number of 60 LEDs, but when you raise that number (200 for example) the easing / lerping cause the lerpVal to skip numbers and thus not all of the LEDs will light.

Example output of lerpVal when using 200 LEDs with a 10ms delay:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 2 2 2 2 3 3 3 3 3 5 5 5 5 5 7 7 7
Which obviously results in LED 1,4,6 not lighting.

This is a very useful demo for beginners, but you run into this issue as soon as you change the number of LEDs to a high enough value or lower the delay. I think it could be worth while to explain how to solve this problem.

having problem to run two effect in one single program

hello, sir i am trying your examples but having trouble to add two example in one program
i am giving example please check and solve my problem.

/* easing
*

  • By: Andrew Tuline
  • Date: August, 2015
  • This boring display demonstrates the easing capability of FastLED. The Red LED starts out slow, speeds up and then slows down when it gets to the end.
  • It uses uint8_t variables:
  • easeOutVal = ease8InOutQuad(easeInVal); // Start with easeInVal at 0 and then go to 255 for the full easing.
  • ledNum = lerp8by8(0, NUM_LEDS, easeOutVal); // Map it to the number of LED's you have.
  • Reference:
  • https://github.com/FastLED/FastLED/wiki/High-performance-math
  • Ideas:
    • Ease from 128 to 255 to throw something in the air
    • Ease from 255 to 128 and reverse direction for it to fall back.
    • Reduce the lerp8 value after each cycle to simulate a bouncing ball.

*/

#include "FastLED.h" // FastLED library. Please use the latest development version.

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

// Fixed definitions cannot change on the fly.
#define LED_DT 6 // Data pin to connect to the strip.
#define LED_CK 11 // Clock pin for WS2801 or APA102.
#define COLOR_ORDER RGB // It's GRB for WS2812 and BGR for APA102.
#define LED_TYPE WS2811 // Using APA102, WS2812, WS2801. Don't forget to change LEDS.addLeds.
#define NUM_LEDS 100 // 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.

struct CRGB leds[NUM_LEDS]; // Initialize our LED array.

int thisdelay = 10;

//---------------------------------------------------------------

uint8_t hue; // Pixel color
uint8_t offset; // To keep track of the offset in the pattern
uint16_t i; // A pixel position on the strip

// How often does the pattern repeat? Change as needed.
static uint16_t repeatEvery = 5;

// Therefore the number of times the pattern will repeat down the strip is:
static uint16_t numberOfRepeats = NUM_LEDS/repeatEvery;

//---------------------------------------------------------------

void setup() {

delay(1000); // Power-up safety delay.
//LEDS.addLeds<LED_TYPE, LED_DT, LED_CK, COLOR_ORDER>(leds, NUM_LEDS); // Use this for WS2801 or APA102
LEDS.addLeds<LED_TYPE, LED_DT, COLOR_ORDER>(leds, NUM_LEDS); // 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() {

EVERY_N_MILLISECONDS(thisdelay) { // FastLED based non-blocking delay to update/display the sequence.
ease();
}

FastLED.show();
repeating_pattern();
} // loop()

void ease() {

static uint8_t easeOutVal = 0;
static uint8_t easeInVal = 0;
static uint8_t lerpVal = 0;

easeOutVal = ease8InOutQuad(easeInVal); // Start with easeInVal at 0 and then go to 255 for the full easing.
easeInVal++;

lerpVal = lerp8by8(0, NUM_LEDS, easeOutVal); // Map it to the number of LED's you have.

leds[lerpVal] = CRGB::Red;
fadeToBlackBy(leds, NUM_LEDS, 16); // 8 bit, 1 = slow fade, 255 = fast fade

} // ease()

void repeating_pattern()
{for (offset = 0; offset < repeatEvery; offset++) { // Operate on each repeating pixel set
hue = (255/repeatEvery) * offset; // Change the hue for each pixel set.
for (uint16_t x = 0; x < numberOfRepeats+1; x++) {
i = (repeatEvery*(x-1)) + repeatEvery + offset; // The pixel number to draw
if (i < NUM_LEDS) { // Only draw pixel numbers within NUM_LEDS
leds[i] = CHSV(hue,180,255);

    FastLED.show();  // Display each pixel individually in a set
    delay(70);
  }
} //end of loop for pixel set

delay(800);  // Pause before lighting next pixel set

} //end offset loop

delay(1000); // pause before clearing
FastLED.clear(); // clear the strip
FastLED.delay(100); // pause before starting over
}

only one example is running (repeating patterns)
this is happening in most of your examples please help me.

Compiling issues

I'm fairly new to programming, I have run through almost all of your demos to help me understand how to program LEDS, and I have gotten almost all of your other demos to work. But with this demo I am having compiling errors. Any ideas how I can fix this? Sorry I'm very new to programming, but it's something that I'd like to try and I like working with LEDS cause they are fun!

HSB to white

Thanks for this all-in-one FastLED collection (I mean "seirlight" pack). It's realy cool.
I've changed the code to use it in openhab through MQTT protocol. All the modes works great!!
Solid color picker works too, but I have a problem whith solid white color.
"Mode 1" sets it perfect, but when I use HSB Values it never go to white and stays in previously selected hue even when brightness goes to 100 and saturation goes to 0.
In other words I can't set the lightly green color (for example), just standart green wich can be dimmed only by brighness trigger.

Want to make class program

Please help me.
i want to write this code as a "class" type (class example is below). I want to add this code with other class examples.

void loop() {
theaterChase(strip.Color(127, 127, 127), 50); // White
theaterChase(strip.Color(127, 0, 0), 50); // Red
theaterChase(strip.Color(0, 0, 127), 50); // Blue
}
void theaterChase(uint32_t c, uint8_t wait) {
for (int j=0; j<10; j++) { //do 10 cycles of chasing
for (int q=0; q < 3; q++) {
for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, c); //turn every third pixel on
}
strip.show();

  delay(wait);

  for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
    strip.setPixelColor(i+q, 0);        //turn every third pixel off
  }
}

}
}

like this class example
class colorWipe: public animation {
public:
colorWipe(void) { w = random(256); }
virtual void init(void);
virtual void show(void);
private:
byte w;
int index;
bool fwd;
};

void colorWipe::init(void) {
int p = random(2, 4);
w += p*16 + 1;
fwd = random(2);
index = 0;
if (!fwd) index = strip.numPixels() - 1;
}

void colorWipe::show(void) {
uint32_t color = Wheel(w);
if (fwd) {
if (index > int(strip.numPixels())) { // Start new sequence with the new color
init();
complete = true;
return;
}
strip.setPixelColor(index++, color);
} else {
if (index < 0) { // Start new sequence with the new color
init();
complete = true;
return;
}
strip.setPixelColor(index--, color);
}
complete = false;
}

Slow FPS

Hi Andrew,
Firstly great work on these effects.
This is more of a question so here it is.

I am using your soundmems code in a project of mine and its working flawlessly on a small strip of leds 40 ws2812s (Code is on a esp8266) I get a steady FPS of 400 with this config, When i increase the LED count to 680 I get a low FPS around 10 or so and the animations dont work as they should, Is this very low FPS expected when running so many LED's?

Regards
Trevor

Separate channels

How can this be modified so that the bands of color can be broken out to separate pins in order to create a color organ?

flicker

if you move the show call into EVERY_N call
output get much more smooth.
I guess that the high refresh rate of leds causes the flicker.

And as long you do not change the LEDs there is no need for a show call.

results in:

void loop () {
EVERY_N_MILLISECONDS(thisdelay) { // FastLED based non-blocking delay to update/display the sequence.
ripple();
show_at_max_brightness_for_power();
}

} // loop()

How do I save the jsbutton as an h file?

When i try to save the JSbutton it opens and saves as a .ino file and not as a .h file, so the button demo reel doesn't compile because there is no such directory. I have tried Save As and type .h after regular address

i want to run normal program with class type of program

NEED HELP
Can i run "class" code with normal example code.
i try but only one of them is running. what should i do please tell me.

class example
class colorWipe: public animation {
public:
colorWipe(void) { w = random(256); }
virtual void init(void);
virtual void show(void);
private:
byte w;
int index;
bool fwd;
};

void colorWipe::init(void) {
int p = random(2, 4);
w += p*16 + 1;
fwd = random(2);
index = 0;
if (!fwd) index = strip.numPixels() - 1;
}

void colorWipe::show(void) {
uint32_t color = Wheel(w);
if (fwd) {
if (index > int(strip.numPixels())) { // Start new sequence with the new color
init();
complete = true;
return;
}
strip.setPixelColor(index++, color);
} else {
if (index < 0) { // Start new sequence with the new color
init();
complete = true;
return;
}
strip.setPixelColor(index--, color);
}
complete = false;
}

Normal example
void theaterChase(uint32_t c, uint8_t wait) {
for (int j=0; j<10; j++) { //do 10 cycles of chasing
for (int q=0; q < 3; q++) {
for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, c); //turn every third pixel on
}
strip.show();

  delay(wait);

  for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
    strip.setPixelColor(i+q, 0);        //turn every third pixel off
  }
}

}
}

only mgr.show is running in this loop
void loop() {
mgr.show();
theaterChase(strip.Color(127, 127, 127), 50); // White
theaterChase(strip.Color(127, 0, 0), 50); // Red
theaterChase(strip.Color(0, 0, 127), 50); // Blue
}
what should i do please tell me.

How to Add More Effects in program

thank you sir,
i Familiar with C and C++ coding. i don't know how how to modify arduino program. Actually i am confused that in which software arduino program can be modified AVR Studio or Arduino IDE.
i want to add more effects of ws2811 led strip.
i see aalight.ino prgoram and i want to add more effects.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.