A Wemos/Lolin D1 mini compatible shield featuring 7x WS2812 serial RGB leds. These are connected in series to digital pin D4 but can be changed via solderable jumper pads on the rear of the module. The shield comes with 2x 8 pin 0.1” pitch male headers supplied unsoldered.
For Arduino users this shield can be used with our HCWS2812 library.
Features:
7 RGB LEDs (WS2812B-mini) each with 24-bit RGB colour
9 optional control pins, Default: D4(GPIO2)
Example sketch
- // Include the ESP266WiFi.h library
- #include <ESP8266WiFi.h>
- // Include the HCWS2812 library
- #include "HCWS2812.h"
- // Create an instance of the library
- // Default pin for Wemos 7 LED shield is D4
- HCWS2812 HCWS2812();
- void setup()
- {
- /* The library requires very precise timing. Therefore WiFi needs to be disabled whilst
- updating the LEDs so that is doesn't get interrupted. */
- WiFi.mode(WIFI_OFF);
- /* After you have updated the LEDs WiFi can be turned back on using one of the following modes:
- * WiFi.mode(WIFI_AP);
- * WiFi.mode(WIFI_STA);
- * WiFi.mode(WIFI_AP_STA);
- */
- }
- void loop()
- {
- RGBBuffer[BLUE][0] = 0;
- RGBBuffer[RED][0] = 255;
- HCWS2812.Refresh();
- delay(1000);
- RGBBuffer[RED][0] = 0;
- RGBBuffer[GREEN][0] = 255;
- HCWS2812.Refresh();
- delay(1000);
- RGBBuffer[GREEN][0] = 0;
- RGBBuffer[BLUE][0] = 255;
- HCWS2812.Refresh();
- delay(1000);
- }
Library:
HCWS2812 library can be downloaded from the software section of this forum here: viewtopic.php?f=58&t=1799
Schematic (V1.0):
Libraries, example code, and diagrams are provided as an additional free service by Hobby Components and are not sold as part of this product. We do no provide any guarantees or warranties as to their accuracy or fitness for purpose.
Descriptions and diagrams on this page are copyright Hobby Components Ltd and may not be reproduced without permission.