Comments (4)
Sorry for the late response. I would have coded like this instead of using the XY helper function:
for (uint8_t y = prevpos; y <= pos; y++) {
for (uint8_t x = 0; x < LEAFCOUNT; x++) {
for(int i = 0;i < LEDS_PER_LEAF;i++)
leds[LEAFCOUNT * LEDS_PER_LEAF + i] = color;
}
from esp8266-fastled-iot-webserver.
Sorry for the late response. I would have coded like this instead of using the XY helper function:
for (uint8_t y = prevpos; y <= pos; y++) { for (uint8_t x = 0; x < LEAFCOUNT; x++) { for(int i = 0;i < LEDS_PER_LEAF;i++) leds[LEAFCOUNT * LEDS_PER_LEAF + i] = color; }
i tried yours but it cant work. there is blank effect. this is my code:
{
// a colored dot sweeping back and forth, with fading trails
fadeToBlackBy(leds, NUM_LEDS, 20);
int pos = beatsin16(speed, 0, NUM_LEDS);
static int prevpos = 0;
//CRGB color = CHSV( gHue, 255, 192);
CRGB color = ColorFromPalette(palettes[currentPaletteIndex], gHue, 255);
for (uint8_t y = prevpos; y <= pos; y++) {
for (uint8_t x = 0; x < LEAFCOUNT; x++) {
for(int i = 0;i < PIXELS_PER_LEAF;i++)
leds[LEAFCOUNT * PIXELS_PER_LEAF + i] = color;
}
}
prevpos = pos;
delay(1000 / FRAMES_PER_SECOND );
}
from esp8266-fastled-iot-webserver.
I don't know if you got this working, but this seems to do it for me.
void sinelon_leaf()
{
// a colored dot sweeping back and forth, with fading trails
fadeToBlackBy(leds, NUM_LEDS, 20);
int pos = beatsin16(speed, 0, LEAFCOUNT);
static int prevpos = 0;
CRGB color = ColorFromPalette(palettes[currentPaletteIndex], gHue, 255);
if (pos < prevpos) {
pos *= PIXELS_PER_LEAF;
fill_solid((leds + pos), (prevpos - pos) + PIXELS_PER_LEAF, color);
}
else {
fill_solid(leds + prevpos, (pos - prevpos) + PIXELS_PER_LEAF, color);
}
prevpos = pos;
delay(100);
}
I added it as an extra pattern.
from esp8266-fastled-iot-webserver.
Thank you
from esp8266-fastled-iot-webserver.
Related Issues (20)
- Missing option "Select Leaf to Color" in current webapp
- Cannot compile for Wemos D1 R2 board when using APA102 LED strip. HOT 1
- Debug, MQTT, and Alexa errors HOT 11
- No hardware SPI pins defined HOT 3
- E (410) SPIFFS: mount failed, -10025 HOT 1
- MQTT enabled cause restart on webserver call HOT 1
- Can't light past 5 triangles (60 lights.) HOT 1
- WebUI wont Load
- MQTT not working HOT 6
- Incorrect ledpattern for clock device which multiple leds per segment
- Getting an error on twinkle HOT 1
- Serial Ambilight !
- ESP8266 NodeMcu can't figure out proper data pin HOT 6
- Web UI up, but no control on the lamps. HOT 1
- One specific LED somewhere in the middle of the chain flickers HOT 1
- MQTT and Home Assistant HOT 1
- Fire effect in nanoleaf
- ESP32 HOT 1
- MQTT - Homeassistant : disconnected due to malformed packet HOT 1
- control reaches end of non-void function [-Werror=return-type] when enabling udp visualization
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp8266-fastled-iot-webserver.