- KEYWORDS: Individually Addressable LEDs,Light,Lights,LED,LEDs,RGB123,RGB,RGB 123,WS2812B,neopixel,Multicolour
The RGB123 LED matrices are boards full of individually addressable RGB LEDs. This means that you can get a full-colour image by wiring up just 3 wires.
We'd suggest you wire up as follows. The only condition is that the data wire is connected to an SPI MOSI port on the Espruino Board:
RGB-123 | Espruino |
---|---|
GND | GND |
DIN | B15 |
5V | VBAT |
When running full-power, the RGB123 panels draw a lot of power. You may find you need to wire the 5V line up to a separate power supply.
DO NOT WIRE UP THE VOLTAGE BACKWARDS - WS2812 chips are quite delicate and can be easily blown up by doing this.
You can then use Espruino's built-in graphics library:
For an 8x8 display, use the following:
SPI2.setup({baud:3200000, mosi:B15});
var leds = Graphics.createArrayBuffer(8,8,24,{zigzag:true});
leds.flip = function() { SPI2.send4bit(leds.buffer, 0b0001, 0b0011); };
// now you can draw..
leds.clear();
// a box
leds.setColor(0.1,0,0);
leds.moveTo(0,0);
leds.lineTo(7,0);
leds.lineTo(7,7);
leds.lineTo(0,7);
leds.lineTo(0,0);
// some text
leds.setColor(0.1,0.1,0.1);
leds.drawString(":)",0,1);
leds.flip();
For other sizes, change the first two arguments of createArrayBuffer
to the width and height of your display.
For more details on interfacing (or for interfacing to RGB123 strips), see [[WS2811]] (the driver chip).