Posts

Showing posts from October, 2017

p5.js and WS281x RGB LEDs

Image
I experimented with an ESP8266 driving WS281x RGB LEDs (also known as Adafruit NeoPixels) using a p5.js sketch to create the pixel images. The ESP8266 web server and web socket server libraries make this easy to do. node.js and socket.io are not used for these demos. The source code is available on github . On the right is an Android tablet running a web browser. The browser is connected to the ESP8266 web and web socket servers. The p5.js sketch is running and generating the pixel images. The p5.js sketch also sends the pixel data to the ESP8266 which drives the RGB LEDs. In the middle are 2 8x8 RGB LED grids connected to form an 8x16 grid. On the left, there is a 5V 1A battery (the block cylinder). The small white circuit board on the top left converts 3.3V to 5V for the RGB LED data pin. Below the white circuit board is the ESP8266 NodeMCU devkit 1.0 board made by Lolin. The next p5.js sketch draws a large circle which follows the finger or mouse cursor on the screen.