IS31FL3731 16x9 Charlieplexed PWM LED Driver Datasheet by Adafruit Industries LLC

View All Related Products | Download PDF Datasheet
1114 I cttaoo . ctrrt' . Itrttl ,urtartrorin (:tttrrttn. alrirtatp. (ltritttao. ullrttrltl. crititttlt. cittttttt: :tttirrtr’. cttttiilit. ottttllttt. tittttltl Litttttltt “to.
IS31FL3731 16x9 Charlieplexed PWM LED Driver
Created by lady ada
Last updated on 2019-05-12 07:13:28 PM UTC
1831FL3731 o PHI"! LED 9x16 LED naxrix Driver Ucc: 2.7-5.5U ( mums
Overview
The IS31FL3731 will let you get back to that classic LED matrix look, with a nice upgrade! This I2C LED driver chip has
the ability to PWM each individual LED in a 16x9 grid so you can have beautiful LED lighting effects, without a lot of
pin twiddling. Simply tell the chip which LED on the grid you want lit, and what brightness and it's all taken care of for
you.
The IS31FL3731 is a nice little chip - it can use 2.7-5.5V power and logic so its flexible for use with any microcontroller.
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 3 of 36
“IIIIIIIII. ”I. Ilttltllu :II;IIIIII “IIIIIIIIIH ”111;.91II1 IIIII/III cIIIIA.IItr cIIIIII/Il IIIIIIIII OIIIIIIIII O Tuo sets of S-pin Charlieplex For use Uilh 31FL3731 dafruit® 8x16 LED Hawix
You can set the address so up to 4 matrices can share an I2C bus. Inside is enough RAM for 8 separate frames of
display memory so you can set up multiple frames of an animation and flip them to be displayed with a single
command.
This chip is great for making small LED displays, and we even designed the breakout to match up with our ready-to-go
LED grids in red, yellow, green, blue and white. Sandwich the driver and matrix breakout, solder together for a
compact setup.
Or
you can DIY your own setup, just follow the LED grid schematic in the IS31FL3731 datasheet.
Pick up a driver board and your favorite color LEDs to match. You'll need to do some basic soldering to attach the
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 4 of 36
driver backpack and matrix together, and run wires to your microcontroller, but its not too hard. Then install our
Arduino code to get some LEDs blinking immediately. Our library is Adafruit_GFX compatible so you can draw lines,
circles, text, and small bitmaps if you want more graphics control
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 5 of 36
,‘T’ZC Driver. 12c Driver:- ISBlFL3731 O PHI”! LED I ‘ 1631FL3731 gpun LED ~5.5U r e w. V D n v a H Ucc: 2.7 m one II 0003 o lth m5:
Pinouts
The IS31FL3731 has a lot of pins, and we wanted to make it easy to use with a breadboard while sandwiched with an
LED matrix. The easiest way we could figure out to do this is make the board as large as our 0603-LED 16x9 matrix
grids and have a control header on one edge. That way you can solder the two long headers directly to the matrix and
still have access to pins for power and data.
Power Pins
You can power the IS31 from 2.7-5.5VDC, but note that the same voltage is used for both power and logic.
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 6 of 36
IsaiFL37ai 0 mm LED 12C Driver: 0 .— D D c \J 51 (32:33 51 95916 5758 lax/byway p15
If you are using a 5V logic device, just connect VCC to 5V.
If you are using a 3.3V logic, you can either power with 3.3V, which will work fine for red, yellow or light green LEDs
or
you can power from 5V and then use ~2.2K resistors from SDA and SCL to 3.3V to 'overpower' the built in 20K pullup
resistors.
I2C Data Pins
This chip uses I2C for control, it does not use clock stretching or repeated start. There are built in 20K pullups to VCC.
You can run it as fast as 400KHz clock speed, but you may need to add additional 2K pullups from SDA and SCL up to
VCC for higher speeds
SDA - I2C data line, connect to your microcontroller's I2C SDA pin
SCL - I2C clock line, connect to your microcontroller's I2C SCL pin
Other Control Pins
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 7 of 36
. . __ E 5x16 501‘ Haxrflx Drivér’ ’ " Ucc: 2.7-5.5!) 2 g1 Q2 Q3 31 9,5 as uv‘k, VVQ“
SD - Shutdown pin, default pulled up to VCC. Connect to ground to put the chip in shutdown mode
AUD - Audio input, can be used to modulate the entire display with the amplitude of a line level audio signal, has
a series capacitor installed.
ADDR and jumpers - By default the address is 0x74 but you can close one of the jumpers to change the address
for up to 4 devices with varying addresses
INTB - Output interrupt from chip when using the built in animation modes
LED Grid
The LED Grid is much simpler, it just has 2 charlieplex grids, 16x9 total 0603 LEDs, with the two grids broken out to
side pins that line up with the driver
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 8 of 36
‘4": .g. .142 fl. 3. fl. .14" g. \i‘\&%: ' ‘5 56k
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 9 of 36
lghl] _ Ihcd. mm sun END 0 Sn 08n°3°u9c© IIHHIIIHH HMHHMH‘ ”’OOOOOOOOOOO mas a7 an as unco 1: who -: sue LED - auix my"
Assembly
Assemble the IS31 Driver Board
We'll start by soldering in the 7-pin 'control' header. Break the headers you received so that you have a 7-pin piece
and collow these steps.
Prepare the header strip:
Cut the strip to length if necessary. It will be easier to
solder if you insert it into a breadboard - long pins down
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 10 of 36
Add the breakout board:
Place the breakout board over the pins so that the short
pins poke through the breakout pads
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 11 of 36
And Solder!
Be sure to solder all pins for reliable electrical contact.
(For tips on soldering, be sure to check out our Guide to
Excellent Soldering
(https://adafru.it/aTk)
).
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 12 of 36
. ‘ f . . ...a. .2..... ...-.3 . . ...2. Eu...- ...-Ia . ...: . I . . . . I J I . . . . I 1 .. .. 3 e . .. ... . 7mm I .. ... qu I .. ... I run .. .... ...uc 3 .. ... p2 .. ... . m I .. ... . . s .. ... . . a u n: . ... .. . . 7 a . I 5 III R II n 5. I. III I R . ... m . ... I a . . a a . n J IIIII l l. . ..... A ...: . ~ . I
OK the control port header is done.
Check your solder joints visually and continue onto the
next steps
Solder Driver Headers for LEDs
The two side strips are what are used to control the charlie-plexed LEDs
Prepare the header strip:
Cut the strip to length if necessary. It will be easier to
solder if you insert it into a breadboard - long pins down
Add the breakout board face up:
Place the breakout board over the pins so that the short
pins poke through the breakout pads
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 13 of 36
:cdo ... 2 an: LEn 1 n ' I S nzlux Oliver 2- u I . m- 2. 5. 5 \ x "' )mAznaMnsaawneas : Dun LED 12C Drive
And Solder!
Be sure to solder all pins for reliable electrical contact.
(For tips on soldering, be sure to check out our Guide to
Excellent Soldering
(https://adafru.it/aTk)
).
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 14 of 36
\ 9x}6 LED r CW NS 7.— D7 X2 mm a: "U
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 15 of 36
_-~.-.. h c: . w * IsalrLJ/u an . mm LED '1“. -. 12c Dnver Rex! m N I r I l I dr D 1; 9x116 LED .1 n x flaxnx any" on: 247 1 SRSR7REAS .» , v z z3lllll.
OK now you have the control
and
LED pads with
headers.
Check your solder joints visually and continue onto the
next steps
Attach LED panel
Now we'll sandwich on the charlieplexed LED panel
The LEDs face out and connect to the two side header
strips.
The panel is symmetric - you can flip it around either
way and it will work fine
Solder in the two long header strips. Not all are
connected on the LED matrix but it makes the
connections mechanically stable.
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 16 of 36
n-u... u..r.r-u \ I \\\\\\\ \\\\\\ \\\\\\ .\\\\\\\ .\\\\\\\\ \\\\\\‘\~. \\\\\\\\\ \\\\\\\\\ \\\\\\\\\ \\\\\\\\\ \\\\\\\\\ \\\\\\\\\ \\\\\\\\\ \\\\\\\\\ .\\\\\\\\\ \\\\\\\\\ \\\\\\\\3 ~
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 17 of 36
\\ \\ \\ \\\. \\ \\§\\\\\. ‘\ ‘\\\\\\\\ \\ i\\\\\\\\.\\ \\\\\\\\\\« \\\\\\\\\\\\\\\\ \\‘\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\ \\\\\\‘\\\\\\\\\ \\\\\\\\\\\\\\\\
Check your solder joints visually and continue onto the
next steps
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 18 of 36
Now you can trim the long header with diagonal cutters.
Cut one or two pins at a time
Watch out for flying header bits. Wear eye protection
and be careful!
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 19 of 36
Cut both sides down for the best look
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 20 of 36
.- .- .- -.u~_\.- ., Villllllltlllill Illllilllltllllt Illi'lltlltlllll tillllflllllllli lllllllllllllfll lt'llll’lillll’d lll’llllllllllli Illlllllllllilll ’llllll’illllll: . . c
You're done! Check your solder joints visually and
continue onto the next steps
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 21 of 36
.4o¢11vaata ¢ovvatrtl. Iaaivttct. alvlitltt» Itap¢cllo. utotavrooo. ‘ovdltoale. {c'OIcvo
Arduino Wiring &
Test
You can easily wire this breakout to any microcontroller, we'll be using an Arduino. For another kind of microcontroller,
as long as you have I2C pins available, just check out the library, then port the code.
Wiring
Use this wiring if you want to connect via I2C interface
Connect Vin to the power supply, 3-5V is fine. Use the same voltage that the microcontroller logic is based off of.
For most Arduinos, that is 5V
Connect GND to common power/data ground
Connect the SCL pin to the I2C clock SCL pin on your Arduino. On an UNO & '328 based Arduino, this is also
known as A5, on a Mega it is also known as digital 21 and on a Leonardo/Micro, digital 3
Connect the SDA pin to the I2C data SDA pin on your Arduino. On an UNO & '328 based Arduino, this is also
known as A4, on a Mega it is also known as digital 20 and on a Leonardo/Micro, digital 2
Download Adafruit_IS31FL3731 library
To begin reading sensor data, you will need to download Adafruit_IS31FL3731 from our github
repository (https://adafru.it/lWA). You can do that by visiting the github repo and manually downloading or, easier, just
click this button to download the zip
https://adafru.it/lWB
https://adafru.it/lWB
Rename the uncompressed folder Adafruit_IS31FL3731 and check that the Adafruit_IS31FL3731 folder contains
Adafruit_IS31FL3731.cpp and Adafruit_IS31FL3731.h
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 22 of 36
® sketdurulok | Who 1.6.7
Place the Adafruit_IS31FL3731 library folder your arduinosketchfolder/libraries/ folder.
You may need to create the libraries subfolder if its your first library. Restart the IDE.
We also have a great tutorial on Arduino library installation at:
http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use (https://adafru.it/aYM)
Install Adafruit GFX
You will need to do the same for the Adafruit_GFX library available here (https://adafru.it/aJa)
https://adafru.it/cBB
https://adafru.it/cBB
Rename the uncompressed folder Adafruit_GFX and check that the Adafruit_GFX folder contains Adafruit_GFX.cpp
and Adafruit_GFX.h
Place the Adafruit_GFX library folder your
arduinosketchfolder
/libraries/ folder like you did with the IS31FL library
Load Demo
Open up File->Examples->Adafruit_IS31FL3731->swirldemo and upload to your Arduino wired up to the driver & matrix
Upload to your Arduino, you'll see the LED display swirl different brightnesses!
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 23 of 36
t otttlltt . nipIItvtai. HIIIIIIIII :IIIIIIIII rIIIIoIIII. :IIIIIIIII UIIIIIOIIIH HIIIIIIIII CIIIIIIIII IIIIIIIIII
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 24 of 36
Library
Reference
Now that you have the demo working, you can control the matrix directly.
Initialize
Start by creating a new matrix object with something like:
There's no arguments to the constructor
Then in your setup, call begin(
address
) to initialize the driver. Begin() will return false if the matrix was not found, and
true if initialization worked out
Drawing
You can then draw to the display. Note that since we write directly to the driver RAM, any pixels 'drawn' will appear
immediately.
You can start with drawPixel(
x, y, brightness
) where x ranges between 0 and 15 inclusive, and y ranges between 0 and
8 inclusive.
Brightness
is the PWM of the LED, 0 is off, and 255 is all the way on.
This loop will light up every LED in increasing brightness:
Adafruit GFX
Once you get pixels drawing, you can use Adafruit GFX to draw lines, rectangles, circles, text, etc.
The Adafruit_GFX library for Arduino provides a common syntax and set of graphics functions for all of our LED, TFT,
LCD and OLED displays. This allows Arduino sketches to easily be adapted between display types with minimal fuss…
and any new features, performance improvements and bug fixes will immediately apply across our complete offering
of color displays.
Check out our detailed tutorial here http://learn.adafruit.com/adafruit-gfx-graphics-library (https://adafru.it/aPx) It covers
the latest and greatest of the GFX library!
Adafruit_IS31FL3731 ledmatrix = Adafruit_IS31FL3731();
if (! ledmatrix.begin()) {
Serial.println("IS31 not found");
while (1);
}
Serial.println("IS31 found!");
int i = 0;
for (uint8_t x=0; x<16; x++) {
for (uint8_t y=0; y<9; y++) {
ledmatrix.drawPixel(x, y, i++]);
}
}
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 25 of 36
Multiple Buffers
The IS31 has 8 full display frame buffers available. By default you draw and display to frame buffer #0
But! If you want to flip thru different images quickly, you can double buffer by writing to one buffer and then telling the
IS31 to switch which one is visible.
To set which frame we are drawing to, use setFrame(
n)
where
n
ranges from 0 to 7 inclusive
Then when you are ready to display it, to set which frame we are displaying to, use displayFrame(
n)
where
n
ranges from 0 to 7 inclusive
ledmatrix.setFrame(frame);
ledmatrix.displayFrame(frame);
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 26 of 36
u... .mcSETEV. \s\\s\\ sssssss sssssss sssssss \ss \\ \ \ .[z‘ \\\\ \\\\\ \\\‘\ ‘\\\\ \‘\‘\ \\\\\ \\\\\ \\\\\ \\\\\ \S\‘\ ‘\\\\ \\ \\ \\ \\ \S ‘\ ‘\ \\ fritzmg
Python &
CircuitPython
It's easy to use the IS31FL3731 Charlieplex breakout, the Charlieplex FeatherWing, and the CharliePlex Bonnet with
Python or CircuitPython and the Adafruit CircuitPython IS31FL3731 (https://adafru.it/zlE) module. This module allows
you to easily write Python code that does all sorts of fun things with the LED matrix.
You can use CharliePlex LED matrices with any CircuitPython microcontroller board or with a computer that has GPIO
and Python thanks to Adafruit_Blinka, our CircuitPython-for-Python compatibility library (https://adafru.it/BSN).
CircuitPython Microcontroller Wiring
First wire up a IS31FL3731 breakout to your board exactly as shown on the previous pages for Arduino.
For the FeatherWing, solder on the headers, and attach to the Feather.
Here's an example of wiring a Feather M0 to the breakout with I2C:
Board 3V to sensor VCC
Board GND to sensor GND
Board SCL to sensor SCL
Board SDA to sensor SDA
And here is the CharlieWing on a Feather M4:
Assemble the CharlieWing by soldering headers
onto the board.
Once assembled, plug it into a Feather!
Python Computer Wiring
Since there's
dozens
of Linux computers/boards you can use we will show wiring for Raspberry Pi. For other platforms,
please visit the guide for CircuitPython on Linux to see whether your platform is supported (https://adafru.it/BSN).
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 27 of 36
fntzmg
For the Bonnet, simply attach the Bonnet to your Raspberry Pi header.
Here's the Raspberry Pi wired to the breakout with I2C:
Pi 3V3 to sensor VIN
Pi GND to sensor GND
Pi SCL to sensor SCL
Pi SDA to sensor SDA
Here is the CharliePlex Bonnet on a Raspberry Pi Zero:
The CharliePlex Bonnet comes fully assembled. Simply
plug it into your Raspberry Pi!
CircuitPython Installation of IS31FL3731 Library
You'll need to install the Adafruit CircuitPython IS31FL3731 (https://adafru.it/zlE) library on your CircuitPython board.
First make sure you are running the latest version of Adafruit CircuitPython (https://adafru.it/Amd) for your board.
Next you'll need to install the necessary libraries to use the hardware--carefully follow the steps to find and install these
libraries from Adafruit's CircuitPython library bundle (https://adafru.it/uap). Our CircuitPython starter guide has a great
page on how to install the library bundle (https://adafru.it/ABU).
For non-express boards like the Trinket M0 or Gemma M0, you'll need to manually install the necessary libraries from
the bundle:
adafruit_is31fl3731.mpy
adafruit_bus_device
Before continuing make sure your board's lib folder or root filesystem has the adafruit_is31fl3731.mpy, and
adafruit_bus_device files and folders copied over.
Next connect to the board's serial REPL (https://adafru.it/Awz) so you are at the CircuitPython >>> prompt.
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 28 of 36
Python Installation of IS31FL3731 Library
You'll need to install the Adafruit_Blinka library that provides the CircuitPython support in Python. This may also
require enabling I2C on your platform and verifying you are running Python 3. Since each platform is a little different,
and Linux changes often, please visit the CircuitPython on Linux guide to get your computer
ready (https://adafru.it/BSN)!
Once that's done, from your command line run the following command:
sudo pip3 install adafruit-circuitpython-is31fl3731 adafruit-circuitpython-framebuf
If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use
CircuitPython on Python 2.x, it isn't supported!
CircuitPython & Python Usage
To demonstrate the usage of the sensor we'll initialize it and manipulate the LED matrix from the board's Python REPL.
NOTE: Due to size and design of each CharliePlex matrix form-factor, import and initialisation is different for each.
Make sure you're running the correct code for your matrix!
First, run the following code to import the necessary modules and create the I2C object:
If you're using the CharliePlex breakout, initialise it by running the following code:
If you're using the CharliePlex FeatherWing, run the following code:
If you're using the CharliePlex Bonnet, run the following code:
When the display initializes it will go through and clear each frame (there are 8 frames total) of the display. You might
see the display momentarily flash and then turn off to a clear no pixel lit image.
You can control all of the board's pixels using the fill function. Send to this function a value from 0 to 255 where 0
is every LED pixel turned off and 255 is every LED pixel turned on to maximum brightness. For example to set all the
pixels to half their brightness run:
import board
import busio
import adafruit_is31fl3731
i2c = busio.I2C(board.SCL, board.SDA)
display = adafruit_is31fl3731.Matrix(i2c)
display = adafruit_is31fl3731.CharlieWing(i2c)
display = adafruit_is31fl3731.CharlieBonnet(i2c)
display.fill(127)
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 29 of 36
iZo he ic
You might notice some buzzing or ringing sounds from the display when all pixels are lit, this is normal as the
Charlieplex driver quickly switches LEDs on and off.
If you've used other displays like LED matrices you might notice the Charlieplex module doesn't need to have a show
function called to make the changes visible. As soon as you call fill or other display functions the display will update!
You can turn all the pixels off with fill set to 0:
Now for some fun! You can set any of the LED pixels using the pixel function. This function takes the following
parameters:
X position - The location of the horizontal / X pixel position.
Y position - The location of the vertical / Y pixel position.
Intensity - This is a value from 0 to 255 which specifies how bright the pixel should be, 0 is off and 255 is
maximum brightness. Use an in-between value to show a less bright pixel.
For example to set pixel 0, 0 to full brightness run:
display.fill(0)
Be careful setting all pixels to 255 maximum brightness! This might pull more power than your computer's
USB port can provide if you are powering your board over USB. Use an external powers supply or battery
when lighting lots of LEDs to max brightness.
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 30 of 36
1&3)??? , wfi\\k\\&w o\\\ks\x u\\\\s\ko Mu... \‘\\\\.. _m\\‘\;\.\ \w “.1‘\\\\\ ‘. \\\\\\x a\\\\n\ko ru\\\\\\, .ssssnsx m4»\m\\\\ ,x\\\u\\h
Or to set the pixel next to it horizontally to half brightness run:
You can turn off individual pixels by setting them to an intensity of zero.
You can even make pixels blink! The board supports a fixed blink rate that you set using the blink function. This
function takes in the number of milliseconds to use for the blink rate (but internally it can only blink in 270ms
increments so you might not get an exact match). For example to blink pixels about once every half second call:
You'll notice nothing actually changes on the board. This is because in addition to intensity each LED pixel has a blink
state which can be enabled and disabled. The fill command can actually set all pixels and turn them on to blink:
You can turn off the blinking by setting blink=False .
The pixel command supports the blink parameter too! You can turn on and off blinking pixel by pixel as needed. For
display.pixel(0, 0, 255)
display.pixel(1, 0, 127)
display.blink(500)
display.fill(127, blink=True)
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 31 of 36
me K s\. - \‘kfikss w.\\\\§\xg J\\\\§\to i»\\s~\\, .\\\‘b\\u m4%\\\\\b._ m,\\‘\k\\g .4.‘\\\b\\., b\\.\%§\
example to turn on blinking for pixel 0, 0 :
Currently the Charlieplex module is very simple and only exposes pixel set commands. In the future more advanced
graphics commands like line drawing, text display, etc. might be implemented but for now you'll need to manipulate
the pixels yourself.
Finally the display supports holding up to 8 frames of pixel data. Each frame contains an entire matrix of LED pixel
state (intensity, blinking, etc.) and by default the module starts you on frame 0. You can change to start displaying and
drawing on another frame by calling frame which takes these parameters:
Frame number - This is the frame number to make the active frame for display or drawing. There are 8 frames
total, 0 through 7.
show - An optional boolean that defaults to True and specifies if the frame should be immediately displayed
(True ) or just made active so that pixel and fill commands draw on it but it's not yet shown.
For example to clear frame 1 and draw a few pixels on it, then display it you can run:
Notice how the first call switches to make frame 1 the active frame but doesn't display it because show is set to false.
Then the frame pixel data is changed with fill and pixel commands, and finally the frame is shown by calling frame
again but letting the default show = True be used so the frame is displayed.
Using frames you can build simple animations by drawing each frame and swapping between them over time!
That's all there is to the basic Charlieplex driver module usage!
Full Example Code
display.pixel(0, 0, 127, blink=True)
display.frame(1, show=False)
display.fill(0)
display.pixel(0, 0, 255)
display.pixel(1, 1, 255)
display.pixel(2, 2, 255)
display.frame(1) # show=True is the default, the frame will be displayed!
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 32 of 36
Text Scrolling Example
NOTE: When running this example on Raspberry Pi, you must have the font8x5.bin file found here (https://adafru.it/Edh)
in the same directory as the program!
wget https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_framebuf/master/examples/font5x8.bin
Temporarily unable to load content:
Temporarily unable to load content:
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 33 of 36
Python Docs
Python Docs (https://adafru.it/C55)
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 34 of 36
mmmmuusmzs ‘W ISSiFL3731 Q + Pun LED I2C Driver Re)“ V. 3x16 LED Haxrix Driver
Downloads
Datasheets & Files
EagleCAD PCB files on GitHub (https://adafru.it/oja)
Fritzing objects in the Adafruit Fritzing library (https://adafru.it/aP3)
IS31FL3731 Datasheet (https://adafru.it/lWC)
IS31FL3731 Breakout
Schematics & Fabrication Print (Dimensions in Inches)
© Adafruit Industries https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver Page 35 of 36
‘4": .g. .142 fl. 3. fl. K. g.
16x9 0603 LED Grid
Schematics & Fabrication print (dimensions in inches)
© Adafruit Industries Last Updated: 2019-05-12 07:13:27 PM UTC Page 36 of 36

Products related to this Datasheet

ADAFRUIT 16X9 CHARLIEPLEXED PWM
LED CHARLIEPLEXED MATRIX - 9X16
LED CHARLIEPLEXED MATRIX - 9X16
LED CHARLIEPLEXED MATRIX - 9X16
LED CHARLIEPLEXED MATRIX - 9X16
LED CHARLIEPLEXED MATRIX - 9X16
LED CHARLIEPLEXED MATRIX - 9X16