Making an Arduino animated frame with 256 RGB Leds!

//Making an Arduino animated frame with 256 RGB Leds!
TUTORIAL


Making a 16×16 RGB Matrix animated frame using an Arduino

HELP OUT

All my content is free.

If you feel that my videos are helping and you would like to contribute, you can toss some coins in the Tip Jar via PayPal.

Select amount then click the “Donate” button.

Brainy-Bits Tip Jar Amount
OVERVIEW

Couple of years ago, I saw someone create an animated picture frame using a 16×16 matrix of RGB LEDs and I thought it was the coolest thing ever!

Since I’m a big retro arcade gaming fan, *I grew up in the 80’s when arcades were still a thing*, I wanted to create one for myself.

The one I saw was using a Raspberry Pi to drive all the LEDs, but I wondered if you could do the same kind of thing using the Arduino.

Since the Arduino’s have no where near the amount of memory available on the Raspberry Pi, I wasn’t sure how many animated characters I could create on an Arduino.

I realized that since the character information which is stored in arrays doesn’t change (meaning that I never update the info) I could save it in Flash memory instead of SRAM where the sketch gets executed normaly.

Since Arduino’s have much more Flash memory available than SRAM, I could store all my character information there and have more space available to create many more.  I was worried that using Flash memory might be too slow, but it worked just fine.

Here’s an example of the amount of memory available on the UNO:

Flash 32k bytes compared to only 2k bytes of SRAM.

The Arduino MEGA has even more:

Flash 256k bytes compared to 8k bytes of SRAM.

In this tutorial I’ll be using the Arduino MEGA, but you could use the UNO as well but of course you will have less space to store the characters.

To create the 16×16 matrix of LEDs, I used regular WS2812B LED strip, the one I used have 60 LEDs per meter, which gave adequate spacing between the LEDs.

You also need to create some sort of grid to isolate the LEDs from one another, I used my Laser Cutter to create the grid but you could also find something that works at the hardware store.

One example would be to use a suspended ceiling light grid.

For the enclosure, I bought a shadow box picture frame at Michael’s.

CONNECTIONS

16X16-RGB-Matrix-Arduino-Schema

Since I’m using a WS2812 LED strip, I only need one connection from the Arduino to control all 256 LEDs.

The led strip I’m using has 60 LEDs per meter and have 3 pins: 5V, GND, and DATA.

Pin 3 of the Arduino MEGA is connected to the Data Pin at the start of the LED strip.

I also connected a 470 ohms resistor inline to protects the Arduino output port from over voltage that could damage the first LED in the strip, this is good practice but never had a problem without one, so it’s optional.

At the end of the first strip you then connect the VCC, GND, and DATA pin to the LED strip below it, and keep doing this until you reach the end.

To power all these LEDs you will need a pretty beefy 5V power supply since the Arduino cannot supply power to that many LEDs.

In theory if all 256 LEDs are lit at 100% brightness and white in color, then the total power consumption would be around 16A.

I connect a capacitor to smooth out the fluctuating current draw by the LED strip, in this case a 1000uF 10V, again this is optional but good practice.

Since I’m only  use 15% brightness and not all the LEDs will be lit up white at any time, I’m using a 5V 10A power supply which is enough for my purposes.

To make sure I don’t get a big voltage drop, I’m connecting the VCC and GND from the power supply to the VCC and GND at the start end end of the LED strip.

THE CODE

Like I said at the beginning I want to save the character animation frames to Flash instead of SRAM.

To achieve this I’m using the PROGMEM command to save the arrays to Flash.  You can see this in the code when I create the array and when I read from it.

In the sketch below you will see 6 arrays for a total of 3 characters.

Each character has 2 array or frames to create a simple animation for each one. Of course you can create as many as you want as long as you have Flash memory available.

Each array has 256 HTML color values that represent each LED in the 16×16 matrix.

I’m using the Fastled library to control the LEDs.

As always for more information about the tutorial and explanation of the code please watch our tutorial video.

/* Arduino 256 RGB LEDs Matrix Animation Frame 
 * Using WS2812 LED Strips
 
Created by Yvan / https://Brainy-Bits.com

This code is in the public domain...

You can: copy it, use it, modify it, share it or just plain ignore it!
Thx!

*/

#include <avr/pgmspace.h>  // Needed to store stuff in Flash using PROGMEM
#include "FastLED.h"       // Fastled library to control the LEDs

// How many leds are connected?
#define NUM_LEDS 256

// Define the Data Pin
#define DATA_PIN 3  // Connected to the data pin of the first LED strip

// Define the array of leds
CRGB leds[NUM_LEDS];

// Create the array of retro arcade characters and store it in Flash memory
const long DigDug01[] PROGMEM =
{
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xcccccc, 0xcccccc, 0xcccccc, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0x000000, 0x000000, 
0x000000, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0x0066cc, 0x000000, 0x0066cc, 0x000000, 0x0066cc, 0x0066cc, 0x0066cc, 0x0066cc, 0xcccccc, 0xcccccc, 0xcccccc, 0x000000, 
0x000000, 0xcccccc, 0xcccccc, 0xcccccc, 0x0066cc, 0x0066cc, 0x0066cc, 0x0066cc, 0x000000, 0x0066cc, 0x000000, 0x0066cc, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0066cc, 0x0066cc, 0x0066cc, 0x0066cc, 0x0066cc, 0x0066cc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0x000000, 
0x000000, 0x000000, 0x000000, 0x0066cc, 0x0066cc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0x000000, 0x000000, 0xff0000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0xff0000, 0xff0000, 0x000000, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0x0066cc, 0x0066cc, 0xcccccc, 0x000000, 0x000000, 
0x000000, 0xff0000, 0xff0000, 0xff0000, 0x0066cc, 0x0066cc, 0x0066cc, 0x0066cc, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0x000000, 
0x000000, 0x000000, 0xff0000, 0xff0000, 0x000000, 0xcccccc, 0xcccccc, 0xcccccc, 0x0066cc, 0x0066cc, 0x0066cc, 0xcccccc, 0xcccccc, 0x000000, 0x000000, 0x000000,  
0x000000, 0x000000, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0x000000, 0x000000, 0xff0000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xcccccc, 0xcccccc, 0x000000, 0x000000, 0x000000, 0xcccccc, 0xcccccc, 0x000000, 0x000000, 
0x000000, 0x000000, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0x000000, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
};

const long DigDug02[] PROGMEM =
{
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xcccccc, 0xcccccc, 0xcccccc, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0x000000, 0x000000, 
0x000000, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0x0066cc, 0x000000, 0x0066cc, 0x000000, 0x0066cc, 0x0066cc, 0x0066cc, 0x0066cc, 0xcccccc, 0xcccccc, 0xcccccc, 0x000000,  
0x000000, 0xcccccc, 0xcccccc, 0xcccccc, 0x0066cc, 0x0066cc, 0x0066cc, 0x0066cc, 0x000000, 0x0066cc, 0x000000, 0x0066cc, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0066cc, 0x0066cc, 0x0066cc, 0x0066cc, 0x0066cc, 0x0066cc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0x000000, 
0x000000, 0x000000, 0x000000, 0x0066cc, 0x0066cc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0x000000, 0x000000, 0xff0000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0xff0000, 0xff0000, 0x000000, 0x000000, 0x000000, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0x0066cc, 0x0066cc, 0xcccccc, 0x000000, 0x000000, 
0x000000, 0xff0000, 0xff0000, 0xff0000, 0x0066cc, 0x0066cc, 0x0066cc, 0x0066cc, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0x000000, 
0x000000, 0x000000, 0xff0000, 0xff0000, 0x000000, 0x000000, 0x000000, 0xcccccc, 0x0066cc, 0x0066cc, 0x0066cc, 0xcccccc, 0xcccccc, 0xcccccc, 0x000000, 0x000000,  
0x000000, 0x000000, 0x000000, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0x000000, 0x000000, 0x000000, 0x000000, 0xff0000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xcccccc, 0xcccccc, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xcccccc, 0xcccccc, 0xcccccc, 0xcccccc, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
};

const long Qbert01[] PROGMEM =
{
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xff0033, 0xff0033, 0xff0033, 0xff0033, 0xff0033, 0xff6600, 0xff6600, 0xff6600, 0x000000, 0x000000, 
0x000000, 0xff0033, 0xff0033, 0xff6600, 0xff0033, 0xffffcc, 0xffffcc, 0xff0033, 0xffffcc, 0xffffcc, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xff0033, 0x000000, 0x000000, 0xff0033, 0xff6600, 0xff6600, 0xff0033, 0xff0033, 
0xff0033, 0xff0033, 0xff0033, 0xff6600, 0xff0033, 0xff0033, 0xff0033, 0xff0033, 0xff0033, 0xff0033, 0xff6600, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0xff0033, 0xff0033, 0xff6600, 0xff6600, 0xff6600, 0xff0033, 0xff0033,  
0xff0033, 0xff0033, 0xff0033, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0x000000, 0x000000, 
0x000000, 0xff6600, 0xff6600, 0xff6600, 0xff0033, 0xff0033, 0xff0033, 0xff6600, 0xff0033, 0xff6600, 0xff0033, 0xff6600, 0xff0033, 0xff6600, 0xff0033, 0xff0033, 
0x000000, 0xff0033, 0xff0033, 0xff0033, 0xff0033, 0xff0033, 0xff6600, 0xff0033, 0xff0033, 0x000000, 0xff0033, 0xff0033, 0x000033, 0x000033, 0xff6600, 0x000000, 
0x000000, 0xff0033, 0x000033, 0x000033, 0xff0033, 0x000000, 0x000000, 0x000000, 0xff0033, 0xff0033, 0xff0033, 0xff0033, 0xff0033, 0xff0033, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0xff0033, 0xff0033, 0xff0033, 0xff0033, 0xff0033, 0x000000, 0x000000, 0x000000, 0x000000, 0xff0033, 0xff0033, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xff0033, 0x000000, 0x000000, 0xff0033, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0xff6600, 0xff6600, 0xff6600, 0x000000, 0x000000, 0xff0033, 0xff6600, 0xff6600, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0xff6600, 0xff6600, 0xff0033, 0x000000, 0x000000, 0xff6600, 0xff6600, 0xff6600, 0xff0033, 0x000000, 0x000000, 0x000000
};

const long Qbert02[] PROGMEM =
{
0x000000, 0x000000, 0x000000, 0x000000, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xff0033, 0xff0033, 0xff0033, 0xff0033, 0xff0033, 0xff6600, 0xff6600, 0xff6600, 0x000000, 0x000000, 
0x000000, 0xff0033, 0xff0033, 0xff6600, 0xff0033, 0xffffff, 0xffffff, 0xff0033, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xff0033, 0x000000, 0x000000, 0xff0033, 0xff6600, 0xff6600, 0xff0033, 0x000000, 
0xff0033, 0xff0033, 0xff0033, 0xff6600, 0xff0033, 0x000000, 0x000000, 0xff0033, 0x000000, 0x000000, 0xff6600, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0xff0033, 0xff0033, 0xff6600, 0xff6600, 0xff6600, 0xff0033, 0xff0033, 
0xff0033, 0xff0033, 0xff0033, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0xff6600, 0x000000, 0x000000, 
0x000000, 0xff6600, 0xff6600, 0xff6600, 0xff0033, 0xff0033, 0xff0033, 0xff6600, 0xff0033, 0xff6600, 0xff0033, 0xff6600, 0xff0033, 0xff6600, 0xff0033, 0xff0033,
0x000000, 0xff0033, 0xff0033, 0xff0033, 0xff0033, 0xff0033, 0xff6600, 0xff0033, 0xff0033, 0x000000, 0xff0033, 0xff0033, 0x000000, 0x000000, 0xff6600, 0x000000, 
0x000000, 0xff0033, 0x000000, 0x000000, 0xff0033, 0x000000, 0x000000, 0x000000, 0xff0033, 0xff0033, 0xff0033, 0xff0033, 0xff0033, 0xff0033, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0xff0033, 0xff0033, 0xff0033, 0xff0033, 0xff0033, 0x000000, 0x000000, 0x000000, 0x000000, 0xff0033, 0xff0033, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xff0033, 0x000000, 0x000000, 0x000000, 0xff0033, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0xff0033, 0x000000, 0x000000, 0x000000, 0xff0033, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xff0033, 0x000000, 0x000000, 0x000000, 0xff0033, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0xff6600, 0xff6600, 0xff6600, 0x000000, 0x000000, 0xff0033, 0xff6600, 0xff6600, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 
0x000000, 0x000000, 0x000000, 0x000000, 0xff6600, 0xff6600, 0xff0033, 0x000000, 0x000000, 0xff6600, 0xff6600, 0xff6600, 0xff0033, 0x000000, 0x000000, 0x000000
};

const long BombJack01[] PROGMEM =
{
0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 
0x333366, 0x333366, 0x333366, 0x0099ff, 0x333366, 0x333366, 0x0099ff, 0x0099ff, 0x0099ff, 0x0099ff, 0x0099ff, 0x333366, 0x333366, 0x0099ff, 0x333366, 0x333366,
0x333366, 0x333366, 0x0099ff, 0x0099ff, 0x0099ff, 0x0099ff, 0x0099ff, 0x0099ff, 0x0099ff, 0x0099ff, 0x0099ff, 0x0099ff, 0x0099ff, 0x333366, 0x333366, 0x333366, 
0x333366, 0x333366, 0x333366, 0x0099ff, 0x0099ff, 0x0099ff, 0xffffff, 0xffffff, 0x0099ff, 0xffffff, 0xffffff, 0x0099ff, 0x0099ff, 0x0099ff, 0x333366, 0x333366, 
0x333366, 0x333366, 0x333366, 0x0099ff, 0x0099ff, 0xffffff, 0x000000, 0x0099ff, 0x000000, 0xffffff, 0x0099ff, 0x0099ff, 0x333366, 0x333366, 0x333366, 0x333366, 
0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x0099ff, 0xffffff, 0x000000, 0x0099ff, 0x000000, 0xffffff, 0x0099ff, 0x333366, 0x333366, 0x333366, 0x333366, 
0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0xffcc99, 0xffcc99, 0xffcc99, 0xffcc99, 0xffcc99, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 
0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0xffffff, 0xffcc99, 0xffcc99, 0xffcc99, 0xffcc99, 0xffcc99, 0xffffff, 0x333366, 0x333366, 0x333366, 0x333366,
0x333366, 0x333366, 0x333366, 0xff0000, 0xff0000, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xff0000, 0xff0000, 0x333366, 0x333366, 0x333366, 0x333366, 
0x333366, 0x333366, 0x333366, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0x000000, 0xff0000, 0x000000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0x333366, 0x333366, 
0x333366, 0x000000, 0x000000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0x000000, 0x000000, 0x333366, 0x333366, 
0x333366, 0x333366, 0x000000, 0x000000, 0xffffff, 0x0099ff, 0x0099ff, 0x0099ff, 0xffff00, 0x0099ff, 0x0099ff, 0x0099ff, 0xffffff, 0x000000, 0x000000, 0x333366, 
0x333366, 0xffffff, 0xffffff, 0xffffff, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xffffff, 0xffffff, 0xffffff, 0x333366, 0x333366, 
0x333366, 0x333366, 0xffffff, 0xffffff, 0xffffff, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xffffff, 0xffffff, 0xffffff, 0x333366,  
0x333366, 0x333366, 0xffffff, 0xffffff, 0xffffff, 0xff0000, 0xff0000, 0xffffff, 0xff0000, 0xff0000, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x333366, 0x333366, 
0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x000000, 0x000000, 0x000000, 0x333366, 0x000000, 0x000000, 0x000000, 0x333366, 0x333366, 0x333366, 0x333366
};

const long BombJack02[] PROGMEM =
{
0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 
0x333366, 0x333366, 0x333366, 0x0099ff, 0x333366, 0x333366, 0x0099ff, 0x0099ff, 0x0099ff, 0x0099ff, 0x0099ff, 0x333366, 0x333366, 0x0099ff, 0x333366, 0x333366, 
0x333366, 0x333366, 0x0099ff, 0x0099ff, 0x0099ff, 0x0099ff, 0x0099ff, 0x0099ff, 0x0099ff, 0x0099ff, 0x0099ff, 0x0099ff, 0x0099ff, 0x333366, 0x333366, 0x333366, 
0x333366, 0x333366, 0x333366, 0x0099ff, 0x0099ff, 0x0099ff, 0xffffff, 0x000000, 0x0099ff, 0x000000, 0xffffff, 0x0099ff, 0x0099ff, 0x0099ff, 0x333366, 0x333366, 
0x333366, 0x333366, 0x333366, 0x0099ff, 0x0099ff, 0xffffff, 0x000000, 0x0099ff, 0x000000, 0xffffff, 0x0099ff, 0x0099ff, 0x333366, 0x333366, 0x333366, 0x333366, 
0x333366, 0x333366, 0x000000, 0x000000, 0x333366, 0x0099ff, 0xffffff, 0xffffff, 0xffcc99, 0xffffff, 0xffffff, 0x0099ff, 0x333366, 0x000000, 0x000000, 0x333366,
0x333366, 0x000000, 0x000000, 0xff0000, 0xffcc99, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffcc99, 0xff0000, 0x000000, 0x000000, 0x333366, 0x333366, 
0x333366, 0x333366, 0x333366, 0xff0000, 0xff0000, 0xffffff, 0xffcc99, 0xffcc99, 0xffcc99, 0xffcc99, 0xffcc99, 0xffffff, 0xff0000, 0xff0000, 0x333366, 0x333366, 
0x333366, 0x333366, 0x333366, 0xff0000, 0xff0000, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xff0000, 0xff0000, 0xffffff, 0x333366, 0x333366, 0x333366, 
0x333366, 0x333366, 0xffffff, 0xffffff, 0xffffff, 0xff0000, 0xff0000, 0x000000, 0xff0000, 0x000000, 0xff0000, 0xff0000, 0xffffff, 0xffffff, 0x333366, 0x333366, 
0x333366, 0x333366, 0xffffff, 0xffffff, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xffffff, 0xffffff, 0xffffff, 0x333366, 0x333366, 
0x333366, 0x333366, 0xffffff, 0xffffff, 0xffffff, 0x0099ff, 0x0099ff, 0x0099ff, 0xffff00, 0x0099ff, 0x0099ff, 0x0099ff, 0xffffff, 0xffffff, 0xffffff, 0x333366,
0x333366, 0xffffff, 0xffffff, 0xffffff, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x333366, 
0x333366, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 
0x333366, 0x333366, 0x333366, 0xffffff, 0xffffff, 0xff0000, 0xff0000, 0xffffff, 0xff0000, 0xff0000, 0xffffff, 0x333366, 0xffffff, 0xffffff, 0x333366, 0x333366, 
0x333366, 0x333366, 0x333366, 0x333366, 0x333366, 0x000000, 0x000000, 0x000000, 0x333366, 0x000000, 0x000000, 0x000000, 0x333366, 0x333366, 0x333366, 0x333366
};



void setup() { 
FastLED.addLeds<NEOPIXEL,DATA_PIN>(leds, NUM_LEDS);  // Init of the Fastled library
FastLED.setBrightness(15);
}

void loop() { 


// Put Qbert first frame
for(int passtime = 0; passtime < 8; passtime++) { // Display it 8 times

FastLED.clear();
for(int i = 0; i < NUM_LEDS; i++) {
    leds[i] = pgm_read_dword(&(Qbert01[i]));  // Read array from Flash
  }

FastLED.show();
delay(500);


// Put Qbert second frame
FastLED.clear();
for(int i = 0; i < NUM_LEDS; i++) {
    leds[i] = pgm_read_dword(&(Qbert02[i]));
  }

FastLED.show();
delay(500);

}


// Put DigDug first frame
for(int passtime = 0; passtime < 8; passtime++) {

FastLED.clear();
for(int i = 0; i < NUM_LEDS; i++) {
    leds[i] = pgm_read_dword(&(DigDug01[i]));
  }

FastLED.show();
delay(250);


// Put DigDug second frame
FastLED.clear();
for(int i = 0; i < NUM_LEDS; i++) {
    leds[i] = pgm_read_dword(&(DigDug02[i]));
  }

FastLED.show();
delay(250);

}


// Put BombJack first frame
for(int passtime = 0; passtime < 8; passtime++) {

FastLED.clear();
for(int i = 0; i < NUM_LEDS; i++) {
    leds[i] = pgm_read_dword(&(BombJack01[i]));
  }

FastLED.show();
delay(400);


// Put BombJack second frame
FastLED.clear();
for(int i = 0; i < NUM_LEDS; i++) {
    leds[i] = pgm_read_dword(&(BombJack02[i]));
  }

FastLED.show();
delay(400);

}

}
TUTORIAL VIDEO
DOWNLOAD

Copy the above Sketch code you want to use above in your Arduino IDE software to program your Arduino.

Download the Fastled Library created by Daniel Garcia and Mark Kriegsman here: Fastled.io

By | 2018-03-06T20:04:58+00:00 March 3rd, 2018|Tutorials|

24 Comments

  1. Alex September 14, 2018 at 8:05 am - Reply

    I have this problem…

    In file included from C:\Users\pc\Documents\Arduino\Matriz_led_Arcade_R0\Matriz_led_Arcade_R0.ino:14:0:

    C:\Users\pc\Documents\Arduino\libraries\FastLED-3.1.8/FastLED.h:17:21: note: #pragma message: FastLED version 3.001.008

    # pragma message “FastLED version 3.001.008”

    Can you help me?

  2. Jazzy September 13, 2018 at 6:38 am - Reply

    Great Project. I know you don’t have the laser files, but do you have the total thickness in mm of those 3 pieces (2 mdf, 1 black) that you used between the glass and The mounting plate. Thanks!

  3. Brian R. September 8, 2018 at 3:23 am - Reply

    Hi! Would a 1/4 Watt 470 ohm resistor work with WS2811 LED pixels?

    • brainy-bits September 8, 2018 at 8:47 pm - Reply

      A 1/4 Watts 470ohms resistor will work just fine with WS2811 as well as WS2812.

  4. Brian R. September 8, 2018 at 2:55 am - Reply

    Hi! Thank you for this, you’re amazing! I’m doing a similar project on a slightly larger scale with WS2811 LED pixels that come in 50 pixel strands (needing 5 strands plus 6 more pixels to make a 16 x 16 256 pixel matrix). These strands have 3-pin JST-SM connectors (5V, Data, Ground) to chain strings together and extra pigtails for “5V” and “Ground” at the beginning and end of each strand. I was wondering if it’s okay to use one power supply but run the 5V and grounds in parallel to distribute (inject) and solve any voltage drop issues. What do you think?

    • brainy-bits September 8, 2018 at 8:50 pm - Reply

      Hi Brian, you can use the same power supply to inject 5V and GND to the Start and the End of the LED strip, as long as the power supply you are using is strong enought (Amp wise) to supply all the LED’s connected. Hope this is what you meant by your questions? Cheers!

    • brainy-bits September 8, 2018 at 8:53 pm - Reply

      After reading your comment again, I understand what you meant: You have a JST connector at the Start and End of your LED strip, but also have 2 extra wires (5V and GND) as well. I believe those extra wires are connected to the same connector that the 5V and GND on the JST are, so if that’s the case, it shouldn’t matter which one you use. But you could use only the Data wire on the JST to connect the Arduino, and use the separate 5V and Ground wires to supply power at the Start and End of your LED strip. Hope that helps! Cheers!

    • brainy-bits September 8, 2018 at 8:57 pm - Reply

      Also don’t forget to check out this tutorial:
      https://www.brainy-bits.com/flickering-led-strip/
      If you have any flickering issues…

  5. E Haber August 3, 2018 at 7:41 pm - Reply

    One other great hack I discovered while building this: I did not cut up my 5M LED strip into pieces and use connectors. If you bend it at each turn, it takes up two LEDs (wasted) on each turn. There are 15 turns, which uses up 30 LEDs. Then there are about 8 or so left over at the end. Then you can plug into both connectors built into the ends of the strip (no soldering or cutting wires). And you do not need those plastic connectors. I found some connectors that worked fine, but there are many that do not work well. And one bad connection and you’ll be pulling your hair out. To compensate for the extra LEDs in the strip, I just wrote a quick translation program that takes the incoming sprite and ignores the LEDs in the turns. It is lightning fast and works great! Had to share because it is MUCH easier than the connectors! Thanks for a great tutorial!

  6. Reese July 26, 2018 at 2:01 pm - Reply

    Would there be a conceivable way to maybe link the display to say an IR Proximity sensor so that when I am close to it, the character changes to show maybe the date or the time? or since everything is done in flash at runtime there is not a way to change things like that? Also, thanks for the tutorials they’ve been a great teaching resource for myself.

  7. Koreen July 16, 2018 at 11:50 am - Reply

    I am a little new to this, but how did you turn the image you wanted into the html array? Thanks

  8. Jester Salivio June 20, 2018 at 6:39 am - Reply

    what connector did you used to connect the RGB LED Strip ? I’m referring the connector on time 2:04 of this tutorial . Thanks in advance

  9. Josh June 12, 2018 at 12:53 am - Reply

    This has been a really fun project and I am definitely learning a lot. I have been making my own graphics and got to the point where I wanted to make a scrolling text. I couldn’t find any code to help me do it the easy way…..Sooo I did it the hard way and just put a bunch of single files at faster refresh rate to make an animation of scrolling text. My text is simple and is 64 frames big. I’m using a Mega and it seems that I am using about half the available memory. I placed this code for the 64 frames at the end of all my other pics/animations, but for some reason it seems that I don’t understand the order in which the code works. I just put the code for each picture after the other in order I wanted them to run, but the code runs from the bottom of my script. I placed the same code at the beginning and all my code run in about 2 seconds. I have only copy and pasted making everything exactly like your example script. Is there something that you can put in a script to make it run a different order? OR is there a way that some scripting could get stuck in the memory and not re-write when I give it new one? If I run each piece separate it seems to work fine….its only when I put the two together that it throws me off. I was going to try it on my uno, but the file is too big. Maybe there’s a simple explanation? Thank you again for such a fantastic website!

  10. Andii May 4, 2018 at 12:04 pm - Reply

    I tried it on my Nodemcu, it worked rly well. But after a short time the array or so broke up? So sometimes the picture got ripped off and idk why – can’t fix it. Maybe it’s the delay or the data connection? Maybe you know what happend (sry for the english im from germany :D). Btw thank you for this great project !

  11. Juan Calderon May 1, 2018 at 11:19 pm - Reply

    how could i edit the code if im making a 10×10 pixel frame sorry it sounds dumb but im new to programming

  12. Guillermo April 29, 2018 at 3:19 pm - Reply

    Hi, very nice project! Can you tell an approx budget to get all this done? Thx.

  13. Michael Young April 28, 2018 at 5:08 pm - Reply

    This is great I even went out and bought the 16 x 16 led board to use with my Arduino as well. Thanks for the code and tutorial, definitely. My question is does anyone have a link possibly for more arduino codes for the 8bit characters?? I am dying to find more of them been searching w/ not much luck…. PS I am somewhat new to all of this as well.

  14. Brent April 20, 2018 at 12:39 am - Reply

    Hey! I love the way you did this! I’ve been racking my brain trying to work out the box, I don’t suppose you could share your laser cutter files? 🙂

    • brainy-bits April 28, 2018 at 5:12 pm - Reply

      Sorry for the late reply, I will put the files available for download here soon!

      • Nick July 26, 2018 at 10:50 pm - Reply

        Just finished putting this together, have added several sprites to it. Great instructions. This is going on display in my arcade room.
        The Laser cut files would be sweet if you could share those. Added a few bucks to your tip Jar Thanks for this. Awesome.

        • brainy-bits July 30, 2018 at 6:44 pm - Reply

          Hi, thanks for your comment, great to hear you built one! Thanks for the tip as well 😉 I’ll try to dig up the laser .DXF files and put them here. Cheers!

        • brainy-bits July 30, 2018 at 11:24 pm - Reply

          Hi, I’ve checked for the files, but the only ones I have left are from LaserCad and it seems I’ve deleted the Adobe Illustrator versions… Doohhh! Sorry about that, but next time I create anything that involves the Laser Cutter, I will put the Illustrator or DXF files available for download.

    • brainy-bits July 30, 2018 at 11:26 pm - Reply

      Like I told Nick, it seems I’ve deleted the Adobe Illustrator versions… and only have the LaserCad versions. Next time I will make available the Illustrator version or DXF files for download. Sorry about that…

Leave A Comment