Giter Club home page Giter Club logo

esp8266-websockets-led's Introduction

Real-time addressable LED strip control using ESP8266 via web interface

Features

  • Synchronization between all connected devices
  • Desktop and mobile web interface
  • Сhoosing themes
  • Brightness adjustment
  • Loop duration adjustment
  • Color change (thanks to NC22 for the colorpicker)
  • Selection of different effects (more will be added)

Hardware

  • ESP8266-based board
  • Addressable LED strip (WS2811, WS2812, WS2812B)
  • 100 to 500 Ohm resistor (preferably)
  • 3.3V to 5V power supply

Wiring diagram

scheme

Software

The web application is a single page application that is written in vanilla JS. So it is quite lightweight

ESP8266 is a web server. After your browser downloads the web files, the connection immediately switches to the websockets protocol. Over this, synchronization between clients was implemented.

Note, although the brightness slider use a delayed event handler (to prevent from flooding the ESP with too many requests too quickly), during execution "heavy" effects (they are marked in the code) with a quick change of brightness, ESP may be unavailable (until effect loop is completed) and messages will go to the senting queue.

Installing

The first thing you need to do is install the Arduino IDE , BUT:

At the moment, latest Arduino IDE (2.0) does not support the file system plugin (required to upload web files to ESP flash memory). See relevance.
Therefore, you need to install version (1.8.x), however:

You can try the simplified version which does not depend on the file system plugin but with a minimalistic interface. When you are sure everything is working, I strongly recommend installing the main version!

The ESP8266 boards will need to be added to the Arduino IDE which is achieved as follows.
The ESP8266 filesystem plugin (you will find the installation instructions in the same place).

Dependency only on the following libraries:

In the end

  • Connect your ESP8266 to your computer
  • Open ESP8266-LED.ino and update the following lines:
#define LED_COUNT 60 // the number of pixels on the strip
#define DATA_PIN 14 // (D5 nodemcu) pin where is connected the data pin

const char* ssid = ""; // SSID of the access point
const char* password = ""; // password (if the access point is open, leave it empty)

IPAddress Ip(192,168,100,10); // IP address for your ESP
IPAddress Gateway(192,168,100,1); // IP address of the access point
  • Upload the sketch
  • In the IDE's top menu, select tools -> ESP8266 Sketch Data Upload to upload files from the data directory to ESP flash memory
  • Open the serial port monitor (if the connection is successful, IP your ESP will be displayed)
  • Open the browser and enter the IP address

Happy use ッ

esp8266-websockets-led's People

Contributors

wirekraken 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

Watchers

 avatar  avatar  avatar  avatar  avatar

esp8266-websockets-led's Issues

Please, do not tell people to power the LEDs through the microcontroller

you can be powered directly from ESP, but the diodes will "flicker"

A single pin of a ESP8266 can only provide 12 mA. The ESP8266 can provide only 1000 mA in total.
A single pin of a ESP32 can only provide 40 mA. The ESP32 can only provide 1200 mA in total.
A single pin of an Arduiono can only provide 20 mA constantly. An Arduino can provide ~400 mA on USB and 900 mA with a power supply.

Given these numbers, let's choose the highest, 1200 mA. With an RGB LED fully lit, that's 60 mA per LED, so you can only power 20 of them. With any LED strip of a decent length, like 3 meters of 60 LEDs per meter, the current can easily exceed 10 Amps (not mA).

Установка режимов.

Автор, спасибо за код.

У меня вопрос, как мне использовать управление лентой так, чтобы режимы включались в зависимости от различных условий? Я планирую реализовать проверку своей почты от конкретного отправителя, и как только пришло новое письмо, включался один из режимов.

Собственно я понять не могу, как написать код внутри условия if для запуска конкретного режима.

while using by AsyncWebSocket , Effects are displaying for 1 millisecond / one time

Hi @wirekraken
I have using asyncwebsocket to avoid the loop method in arduino
After changing effects are not working properly

Can you guide on this ?

I am using simplified version

in html.h
webSocket = new WebSocket('ws://' + window.location.hostname + '/ws');

ESP8266-LED.ino

/**
 * Simplified version
 * @author   Alexander Voykov <wirekraken>
 * @version  2.0
 * @link     https://github.com/wirekraken/ESP8266-Websockets-LED
**/

//#include <ESP8266WebServer.h> // auto installed after installing ESP boards
#include "ESPAsyncWebServer.h"
//#include <WebSocketsServer.h> // by Markus Settler
#include "AsyncWebSocket.h"
#include <FastLED.h> // by Daniel Garcia

#include "html.h" // html code here

#define LED_COUNT 30 // the number of pixels on the strip
#define DATA_PIN D4 // (D5 nodemcu), important: https://github.com/FastLED/FastLED/wiki/ESP8266-notes

// SSID and password of the access point
const char* ssid = "BSNL_3G";
const char* password = "bsnl2022";

// static IP address configuration
IPAddress Ip(192,168,100,10); // IP address for your ESP
IPAddress Gateway(192,168,100,1); // IP address of the access point
IPAddress Subnet(255,255,255,0); // subnet mask

// default values. You will change them via the Web interface
uint8_t brightness = 25;
uint32_t duration = 10000; // (10s) duration of the effect in the loop
uint8_t effect = 0;

bool isPlay = false;
bool isLoopEffect = false;
bool isRandom = false;

// effects that will be in the loop
uint8_t favEffects[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33};
uint8_t numFavEffects = sizeof(favEffects);

uint32_t lastChange;
uint8_t currentEffect = 0;

CRGBArray<LED_COUNT> leds;
// variables for basic effects settings
uint8_t _delay = 20;
uint8_t _step = 10;
uint8_t _hue = 0;
uint8_t _sat = 255;

// initializing the websocket server on port 81
//WebSocketsServer webSocket(81);
//ESP8266WebServer server; // 80 default

AsyncWebSocket webSocket("/ws");
AsyncWebServer server(80);

void setup() {
  Serial.begin(9600);

  // tell FastLED about the LED strip configuration
  LEDS.addLeds<WS2811, DATA_PIN, GRB>(leds, LED_COUNT);
  // set the brightness
  LEDS.setBrightness(brightness);
  updateColor(0,0,0);
  LEDS.show(); // set new changes for led

  //WiFi.config(Ip, Gateway, Subnet);
  
  WiFi.begin(ssid, password);
  Serial.println("");
  WiFi.mode(WIFI_STA);

  // wait for connection
  while (WiFi.status() != WL_CONNECTED) { 
    delay(500);
    Serial.print(".");
  }
  
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP()); // IP adress assigned to your ESP

  server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
        request->send(200, "text/html", html);
    });

  server.begin();
  //webSocket.begin();

  // binding callback function
  webSocket.onEvent(webSocketEvent);
  server.addHandler(&webSocket);
  
}

void loop() {

  // no need below two as both are async
  //webSocket.loop(); // constantly check for websocket events
  //server.handleClient(); // run the web server

  if (isPlay) {
    String sendData;

    if (isLoopEffect) {
      if ((millis() - lastChange) > duration) {
        setFavEffects(favEffects, numFavEffects);
    
        sendData = "E_" + String(currentEffect, DEC);
        webSocket.broadcastTXT(sendData);
        Serial.println("Sent: " + sendData);
        
      }
    }
    if (isRandom) {
      if ((millis() - lastChange) > duration) {
        lastChange = millis();
        effect = favEffects[random(0, numFavEffects - 1)];
        currentEffect = effect - 1;

        sendData = "E_" + String(effect, DEC);
        webSocket.broadcastTXT(sendData); // send the number of the current effect
        Serial.println("Sent: " + sendData);
      
      }
    }
    setEffect(effect);
  }

}

void setFavEffects(const uint8_t *arr, uint8_t count) {
  if (currentEffect > (count - 1)) {
    currentEffect = 0;
  }
  effect = arr[currentEffect++];
  lastChange = millis();
}

// the callback for handling incoming data
void webSocketEvent(AsyncWebSocket *server, AsyncWebSocketClient *client, AwsEventType type, void *arg, uint8_t *data, size_t len) {
    switch (type) {
      case WS_EVT_CONNECT:
        Serial.printf("WebSocket client #%u connected from %s\n", client->id(), client->remoteIP().toString().c_str());
        break;
      case WS_EVT_DISCONNECT:
        Serial.printf("WebSocket client #%u disconnected\n", client->id());
        break;
      case WS_EVT_DATA:
        messageHandler(arg, data, len);
        break;
      case WS_EVT_PONG:
      case WS_EVT_ERROR:
        break;
  }
}

void messageHandler(void *arg, uint8_t *data, size_t length) {

  String getData;
  String sendData;

  AwsFrameInfo *info = (AwsFrameInfo*)arg;
  if (info->final && info->index == 0 && info->len == length && info->opcode == WS_TEXT) {
    data[length] = 0;
    
     for (int i = 0; i < length; i++) {
      if (!isdigit(data[i])) continue;
        getData += (char) data[i];
      }

  
    switch (data[0]) {
      // effect
      case 'E':
        isPlay = true;
        effect = getData.toInt();
        Serial.println(getData);

        currentEffect = getData.toInt() - 1; // so that the loop starts from the current one

        sendData = "E_" + getData;
        webSocket.textAll(sendData);
        
        setEffect(effect);
      break;
      // brightness
      case 'B':
        Serial.println(getData);
        brightness = map(getData.toInt(), 0, 100, 0, 255);
        
        sendData = "B_" + getData;
        webSocket.textAll(sendData);
        
        LEDS.setBrightness(brightness);
      break;
      // duration
      case 'D':
        Serial.println(getData);
        duration = (getData.toInt() * 1000);

        sendData = "D_" + getData;
        webSocket.textAll(sendData);
      break;
      // play
      case 'P':
        if (getData == "1") {
          isPlay = true;
          if (effect == 0) {
            effect = 1;
          }
          sendData = "E_" + String(effect, DEC);
          webSocket.textAll(sendData);
        } 
        else {
          isPlay = false;
        }
        sendData = "P_" + getData;
        webSocket.textAll(sendData);
      break;
      // loop
      case 'L':
        if (getData == "1") {
          isPlay = true;
          isLoopEffect = true;
          isRandom = false;
        } 
        else {
          isLoopEffect = false;
        }
        sendData = "L_" + getData;
        webSocket.textAll(sendData);
      break;
      // random
      case 'R':
        if (getData == "1") {
          isPlay = true;
          isLoopEffect = false;
          isRandom = true;
        } 
        else {
          isRandom = false;
        }
        sendData = "R_" + getData;
        webSocket.textAll(sendData);
      break;
    }
    Serial.println("Sent: " + sendData);
  }
}


// call the desired effect
void setEffect(const uint8_t num) {
  switch(num) {
    case 0: updateColor(0,0,0); break;
    case 1: rainbowFade(); _delay = 20; break;
    case 2: rainbowLoop(); _delay = 20; break;
    case 3: rainbowLoopFade(); _delay = 5; break;
    case 4: rainbowVertical(); _delay = 50; _step = 15; break;
    case 5: randomMarch(); _delay = 40; break;  
    case 6: rgbPropeller(); _delay = 25; break;
    case 7: fire(55, 120, _delay); _delay = 15; break; 
    case 8: blueFire(55, 250, _delay); _delay = 15; break;  
    case 9: randomBurst(); _delay = 20; break;
    case 10: flicker(); _delay = 20; break;
    case 11: randomColorPop(); _delay = 35; break;
    case 12: sparkle(255, 255, 255, _delay); _delay = 0; break;
    case 13: colorBounce(); _delay = 20; _hue = 0; break;
    case 14: colorBounceFade(); _delay = 40; _hue = 0; break;
    case 15: redBlueBounce(); _delay = 40; _hue = 0; break;
    case 16: rotatingRedBlue(); _delay = 40; _hue = 0; break;
    case 17: matrix(); _delay = 50; _hue = 95; break;
    case 18: radiation(); _delay = 60; _hue = 95; break;
    case 19: pacman(); _delay = 60; break;
    case 20: popHorizontal(); _delay = 100; _hue = 0; break;
    case 21: snowSparkle(); _delay = 20; break;

    // heavy effects (have nested loops and long delays)
    // don't be surprised when your ESP will slow down with a quick change of brightness for them
    case 22: rwbMarch(); _delay = 80; break;
    case 23: flame(); break;
    case 24: theaterChase(255, 0, 0, _delay); _delay = 50; break;
    case 25: strobe(255, 255, 255, 10, _delay, 1000); _delay = 100; break;
    case 26: policeBlinker(); _delay = 25; break;
    case 27: kitt(); _delay = 100; break;
    case 28: rule30(); _delay = 100; break;
    case 29: fadeVertical(); _delay = 60; _hue = 180; break;
    case 30: fadeToCenter(); break;
    case 31: runnerChameleon(); break;
    case 32: blende(); break;
    case 33: blende_2();

  }
}

Can't get the website up and running

Hi,
I can't seem to get the webserver up and I do not see what I could be doing wrong.
Connection to wifi seems ok as I can ping the assigned ipadress but I'm getting "file not found."
The led matrix itself is working.

Soft WDT resets

Hello, I am trying to run your code on my ESP8266 and am getting soft WDT resets in the serial monitor. I will provide the code and anything else if necessary.

Lots of errors

Seems after 2 years, a lot has changed :D

Throws an abundance of errors when trying to compile to upload using latest esptool, esp8266 board info for arduino, and fastled 3.x

I can't seem to get the webserver up

Hi,
I can't seem to get the webserver up and I do not see what I could be doing wrong.
Connection to wifi seems ok as I can ping the assigned ipadress but I'm getting "file not found."
The led matrix itself is working.
Tried another project with a webserver and that worked fine.

Call of overloaded `abs(uint32_t)` is ambiguous

Arduino: 1.8.15 (Linux), Плата:"Generic ESP8266 Module, 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, dtr (aka nodemcu), 26 MHz, 40MHz, DOUT (compatible), 1MB (FS:64KB OTA:~470KB), 2, nonos-sdk 2.2.1+100 (190703), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

In file included from /home/artem/Arduino IDEA/libraries/FastLED-master/src/FastLED.h:67,
from /home/artem/Загрузки/ESP8266-Websockets-LED-master/ESP8266-LED/ESP8266-LED.ino:7:
/home/artem/Arduino IDEA/libraries/FastLED-master/src/fastspi.h:145:23: note: '#pragma message: No hardware SPI pins defined. All SPI access will default to bitbanged output'
145 | # pragma message "No hardware SPI pins defined. All SPI access will default to bitbanged output"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/artem/Загрузки/ESP8266-Websockets-LED-master/ESP8266-LED/ESP8266-LED.ino: In function 'void webSocketEvent(uint8_t, WStype_t, uint8_t*, size_t)':
ESP8266-LED:125:50: error: call of overloaded 'abs(uint32_t)' is ambiguous
125 | uint8_t r = abs(0 + (rgb >> 16) & 0xFF);
| ^
In file included from /home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/cstdlib:75,
from /home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/stdlib.h:36,
from /home/artem/snap/arduino/61/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/Arduino.h:27,
from sketch/ESP8266-LED.ino.cpp:1:
/home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/stdlib.h:74:5: note: candidate: 'int abs(int)'
74 | int abs (int);
| ^~~
In file included from /home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/cstdlib:77,
from /home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/stdlib.h:36,
from /home/artem/snap/arduino/61/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/Arduino.h:27,
from sketch/ESP8266-LED.ino.cpp:1:
/home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
79 | abs(long double __x)
| ^~~
/home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
75 | abs(float __x)
| ^~~
/home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
71 | abs(double __x)
| ^~~
/home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
61 | abs(long long __x) { return __builtin_llabs (__x); }
| ^~~
/home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
56 | abs(long __i) { return __builtin_labs(__i); }
| ^~~
ESP8266-LED:126:50: error: call of overloaded 'abs(uint32_t)' is ambiguous
126 | uint8_t g = abs(0 + (rgb >> 8) & 0xFF);
| ^
In file included from /home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/cstdlib:75,
from /home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/stdlib.h:36,
from /home/artem/snap/arduino/61/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/Arduino.h:27,
from sketch/ESP8266-LED.ino.cpp:1:
/home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/stdlib.h:74:5: note: candidate: 'int abs(int)'
74 | int abs (int);
| ^~~
In file included from /home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/cstdlib:77,
from /home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/stdlib.h:36,
from /home/artem/snap/arduino/61/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/Arduino.h:27,
from sketch/ESP8266-LED.ino.cpp:1:
/home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
79 | abs(long double __x)
| ^~~
/home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
75 | abs(float __x)
| ^~~
/home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
71 | abs(double __x)
| ^~~
/home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
61 | abs(long long __x) { return __builtin_llabs (__x); }
| ^~~
/home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
56 | abs(long __i) { return __builtin_labs(__i); }
| ^~~
ESP8266-LED:127:50: error: call of overloaded 'abs(uint32_t)' is ambiguous
127 | uint8_t b = abs(0 + (rgb >> 0) & 0xFF);
| ^
In file included from /home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/cstdlib:75,
from /home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/stdlib.h:36,
from /home/artem/snap/arduino/61/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/Arduino.h:27,
from sketch/ESP8266-LED.ino.cpp:1:
/home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/stdlib.h:74:5: note: candidate: 'int abs(int)'
74 | int abs (int);
| ^~~
In file included from /home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/cstdlib:77,
from /home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/stdlib.h:36,
from /home/artem/snap/arduino/61/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/Arduino.h:27,
from sketch/ESP8266-LED.ino.cpp:1:
/home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
79 | abs(long double __x)
| ^~~
/home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
75 | abs(float __x)
| ^~~
/home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
71 | abs(double __x)
| ^~~
/home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
61 | abs(long long __x) { return __builtin_llabs (__x); }
| ^~~
/home/artem/snap/arduino/61/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
56 | abs(long __i) { return __builtin_labs(__i); }
| ^~~
Несколько библиотек найдено для "FastLED.h"
Используется: /home/artem/Arduino IDEA/libraries/FastLED-master
Не используется: /home/artem/Arduino IDEA/libraries/FastSPI_LED2-master
exit status 1
call of overloaded 'abs(uint32_t)' is ambiguous

Этот отчёт будет иметь больше информации с
включенной опцией Файл -> Настройки ->
"Показать подробный вывод во время компиляции"

Changing colors from color picker affects only the first LED.

Hello,
I am using ESP8266 WEMOS D1 MINI PRO , that is controlling 17 LED WS2812B.
I had a problem when i try to pick any color from color picker.
The problem is that color change only applies to the first LED, and even then, the color is not the one i choose.
If i try to pick another color, sometimes all the leds are refreshed.
The problem is present in effects, but its not noticeable.

The solution was to put two LEDS.show(); and two FastLED.show(); one after another both in ESP8266-LED.ino and effects.ino.

EXAMPLE:

      for (int i = 0; i < LED_COUNT; i++) {
        leds[i].setRGB(r,g,b);
      }
      LEDS.show();
      LEDS.show(); // THAT ONE IS NEEDED FOR THE PROPER WORK

LED_COUNT

Thanks for your code it saved me a lot of time 👍
Hi using your project I found that if the number of leds exceed 254 program does not start.
Using the same library FastLED v3.3.3 by Danie Garcia with other sketch works fine with higher number of leds
more i found I have to add
#define FASTLED_ALLOW_INTERRUPTS 0
#define FASTLED_INTERRUPT_RETRY_COUNT 0
#define FASTLED_ESP8266_RAW_PIN_ORDER
//before
#include <FastLED.h>
could you pls check if there is a possible type conflict with LED_COUNT?
Spasibo bolshoe 🥇

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.