Charlieplexed LED Module

Charlieplexing is a way of wiring up LED lights that takes advantage of the the fact that they only light up when connected one way around.

You can connect LEDs up in such a way that with N IO pins, you can control N*(N-1) LED lights.

You can control Charlieplexed LED lights using the Charlieplex (About Modules) module.

Note: Charlieplexed LEDs require constant updates (ideally via interrupts and timers). Espruino doesn't allow you to do this at the moment, so you will find that if you update the display or write functions that take a long time to execute, the display will flicker.

To use the module, simply connect up an array of Charlieplexed LEDs and use:

var g = require("Charlieplex").connect([pin1,pin2,pin3,...]);

You'll then get a Graphics object, which you can use just like any other graphics object. When you're done drawing, just call g.flip() to update the display with the latest information. For instance:

var g = require("Charlieplex").connect([C0,C1,C2,C3,A0]);
g.drawLine(0,0,g.getWidth()-1,g.getHeight()-1);
g.flip();

The following code will create simple scrolling text saying "Hello World":

var g = require("Charlieplex").connect([C0,C1,C2,C3,A0]);
g.setRotation(1);

var n = -g.getWidth();
setInterval(function() {
  var s = "Hello World";
  g.clear();
  g.drawString(s,-n,0);
  n++;
  if (n>g.stringWidth(s)) n=-g.getWidth();
  g.flip();
},200);

Using

(No tutorials are available yet)

Buying

You can buy Charlieplexed LEDs from the places below (and many others), or it's easy enough to wire up your own.

Note: You won't get very good results with large matrices - we'd suggest using only matrices with less than 8 pins (less than 8x7 LEDs).

This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.