All Projects → bertmelis → esp32WS2811

bertmelis / esp32WS2811

Licence: MIT License
Arduino library for ESP32 to drive WS2811 LEDs using the RMT peripheral

Programming Languages

C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to esp32WS2811

WS281x.swift
A Swift library for WS281x (WS2811,WS2812*,WS2813*) RGB led strips, rings, sticks, matrices and more.
Stars: ✭ 32 (+45.45%)
Mutual labels:  ws2812, ws2811, ws281x
rpi-ws2812-server
Raspberry Pi WS2812 (web) server tool
Stars: ✭ 143 (+550%)
Mutual labels:  ws2812, ws2811
Somfy Remote Lib
Emulate a Somfy remote using a 433.42 MHz transmitter.
Stars: ✭ 43 (+95.45%)
Mutual labels:  esp32, arduino-library
esp-logger
An Arduino library providing a minimal interface to log data on flash memory and SD cards with ESP8266 and ESP32
Stars: ✭ 40 (+81.82%)
Mutual labels:  esp32, arduino-library
Arduino-BLE-MIDI
MIDI over Bluetooth Low Energy (BLE-MIDI) 1.0 for Arduino
Stars: ✭ 133 (+504.55%)
Mutual labels:  esp32, arduino-library
TinyPixelMapper
a Pixelmapping software for the ESP32 and ESP8266 for addressible LED Strips, with a OSC controll interface and FFT
Stars: ✭ 22 (+0%)
Mutual labels:  esp32, esp32-arduino
WiFiConnect
WiFi connection manager for ESP32 and ESP8266 with OLED support
Stars: ✭ 28 (+27.27%)
Mutual labels:  esp32, arduino-library
esp-rgb-led-matrix
Full RGB LED matrix, based on an ESP32 and WS2812B LEDs.
Stars: ✭ 91 (+313.64%)
Mutual labels:  esp32, esp32-arduino
esp32cam-ready
Plug and Play firmware for the esp32cam. Flash, provision and connect to rtsp.
Stars: ✭ 67 (+204.55%)
Mutual labels:  esp32, esp32-arduino
HomeSpan
HomeKit Library for the Arduino-ESP32
Stars: ✭ 410 (+1763.64%)
Mutual labels:  esp32, arduino-library
FirebaseJson
🗃 JSON parser and builder for ESP8266, ESP32, Teensy3.x and Teensy4.x, SAM, SAMD and STM32 (128 k flash or more)
Stars: ✭ 29 (+31.82%)
Mutual labels:  esp32, arduino-library
Farm-Data-Relay-System
A system that uses ESP-NOW, LoRa, and other protocols to transport sensor data in remote areas without relying on WiFi.
Stars: ✭ 97 (+340.91%)
Mutual labels:  esp32, esp32-arduino
TP Arduino DigitalRain Anim
A library that represents Digital Rain Animation on color displays that support TFT_eSPI
Stars: ✭ 80 (+263.64%)
Mutual labels:  esp32, arduino-library
ESP-Mail-Client
⚡️Arduino Mail Client Library to send, read and get incoming mail notification for ESP32, ESP8266 and SAMD21 devices. The library also supported other Arduino devices using Clients interfaces e.g. WiFiClient, EthernetClient, and GSMClient.
Stars: ✭ 78 (+254.55%)
Mutual labels:  esp32, arduino-library
telnetspy
Telnet Server For ESP8266: Cloning the serial port via Telnet. "Debugging over the air"
Stars: ✭ 41 (+86.36%)
Mutual labels:  esp32, arduino-library
OpenWeather
Arduino library to fetch weather forecasts from OpenWeatherMap
Stars: ✭ 88 (+300%)
Mutual labels:  esp32, arduino-library
PCF8575 library
Library to use i2c digital expander with arduino, esp8266 and esp32. Can read write digital value with only 2 wire (perfect for ESP-01).
Stars: ✭ 28 (+27.27%)
Mutual labels:  esp32, arduino-library
esp32FOTA
Experiments in firmware OTA updates for ESP32 dev boards
Stars: ✭ 185 (+740.91%)
Mutual labels:  esp32, esp32-arduino
M5Stack-Air-Quality-ESPHome
ESPHome configuration for M5Stack's PM2.5 Air Quality Kit with the PMSA003 particulate matter sensor and the SHT20 temperature and humidity sensor
Stars: ✭ 19 (-13.64%)
Mutual labels:  esp32, esp32-arduino
esptool
esptool.py replacement written in #golang
Stars: ✭ 18 (-18.18%)
Mutual labels:  esp32, esp32-arduino

esp32WS2811

Arduino Library for ESP32 to drive WS2811/WS2812 RGB leds using the RMT peripheral. The lib is lean and only drives the leds.

Hardware

As the ESP32 uses 3.3V levels and the WS2811 uses 5V, we need a level shifting device. I'm successfully using a TXS-0102 voltage-level translator. I've tested up to 50 leds and wire lengths to the first LED up to 2 meters.

Example circuit:

                                  3.3V                                  5V
                                    |                                    |
                                    |                                    |
      +--------------+              |         +---------------+          |
      |          Vin +--------------+---------+ Vcca     Vccb +----------+
      |              |                        |               |          |
      |      GPIO 23 +--------------------+-->+ OE       GND  +---+--||--+----- Vdd WS2811
      |     ESP32    |                    |   |     TXS0102   |   |  0.1µF
      |      GPIO 18 +----------------------->+ A1         B1 +---------------- DATA WS2811
      |              |                    |   |               |   |
      |     GND      |                    |   | A2         B2 |   +------------ GND WS2811
      +------+-------+                    |   +---------------+   |
             |                            |                       |
             |                            +--/\/\/\---+-------- --+
             |                                10k     |
             +----------------------------------------+
                                                      |
                                                     ---

The pulldown resistor on OE (output enable) prevents the output to float during startup. Unused pins are left unconnected as they have internal 10k pullups.

Firmware

Include the header file and define your LED string:

#include <esp32WS2811.h>

// first argument is the data pin, the second argument is the number of LEDs
WS2811 yourLedString(18, 50);

Start the LED string:

void setup() {
  // include your other code

  yourLedString.begin();
}

Change LED colours:

Colour colour = yourLedString.getPixel(size_t index);  // gives you the Colour of the led on index.
yourLedString.setPixel(size_t index, uint32_t red, uint32_t green, uint32_t blue);
yourLedString.show();  // this actually makes the LEDs light up

A number of helpers methods are available:

yourLedString.clearAll();  // turns off all LEDs
yourLedString.setAll(Colour colour);  // // gives all LEDs the specified colour
yourLedString.setAll(uint32_t red, uint32_t green, uint32_t blue);  // gives all LEDs the specified colour

Keep in mind that all these methods require to call show() afterwards.

Effects

Starting and stopping an effect is done by:

void startEffect(WS2811Effect* effect);
void stopEffect();

You don't have to stop a running effect before starting a new one. The effect stops immediately and does not wait for it's routine to complete.

Sample application

You can find a full working application in this repo: ledController

Credits

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].