Quick start guide

Note: After unboxing Beam, we highly recommend running through this quick start guide to verify everything is working as expected! 

 

Overview

The Beam PCB has 120 LEDs arranged in a 5x24 grid. The 5x24 grid makes it ideal to display text or animations in your projects. Beam is compatible with both 5V and 3.3V microcontrollers and communicates via I2C.  

Hookup

On the backside of the Beam PCB, there are two female connectors on each end. Both connectors are identical and either one can be used to connect to the your host microcontroller. 

HOST_V+: Connect to either 5V or 3.3V depending on your microcontroller. For example, if using the Arduino UNO, this pin should be tied to 5V since it is a 5V platform. The Particle Photon is a 3.3V platform, so this pin should be tied to 3.3V instead. 
3.3V: Connect to the 3.3V pin on your host microcontroller
GND: Connect to ground pin. 
SYNC: No need to connect this pin to your microcontroller. It's used when chaining multiple Beams in a row. 
RESET: Connect to any Digital pin on your microcontroller. 
IRQ: Not used at the moment. Leave unconnected. 
SCL: Connect to SCL pin on your microcontroller
SDA: Connect to SDA pin on your microcontroller. 

Library

Hit the link on the right to grab the latest Beam library. 

Upload

Before you hit upload, here are a few things to watch out for. 

  • If using one Beam, set the slider switch on the back to setting 'A'. 
  • Note the #define BEAMCOUNT at the top of the main .ino file. This should be set to the number of Beams you're using. We recommend setting it to 1 and testing with a single Beam before trying the other examples. 
  • Make sure the RSTPIN is set to the correct digital pin. 

Now hit upload and you should see text and animations appear on Beam. Depending on the i2c speed supported by your microcontroller, it could take a few seconds to finish updating all the registers. Open the serial monitor and you should see a few debug messages being logged. 

Connecting more Beams

Want MOAR Beams? Simply connect up to 4 Beams using the headers provided as shown. Going from left to right, make sure the slider switch is set to 'A' for the first Beam, then 'B' for the second Beam, and so on. So of you're using a total of four Beams, then the switch setting should be A, B, C, D from left to right. 


 

Beam Library - Basic Features

Initializing Beam

We begin by creating an instance of Beam with the following line. The variable BEAMCOUNT should be set to the number of Beams that are connected together in a chain. 

Beam b = Beam(RSTPIN, IRQPIN, BEAMCOUNT);

Next, the 'begin' function will reset Beam and initialize it. If multiple Beams are connected, all the exposed pins are connected to each other. This means calling the 'begin' function just once will initialize all Beams connected in the daisy chain. 

b.begin();

Displaying Text

Now we call the 'print' function. This takes a string of text and maps each character to the dot-matrix font stored in the charactermap.h header file. By default, each character includes one space for better readability. Calling this function will automatically print the text across all connected Beams. 

b.print("Hello World");

Then we have a few options to change the mode, speed, loops and scroll direction. 

b.setSpeed(3);// value between 1 and 15. Lower value is faster. 
b.setLoops(7);// value between 1 and 7. For an infinite loop, set to 7. 
b.setScroll(LEFT);// takes the value LEFT or RIGHT. 
b.setMode(SCROLL);// SCROLL for scrolling. MOVIE for animations. 

Finally, we can start lighting up some LEDs. Use the 'play' method to start the animation. If setMode(SCROLL) is called before the 'play' method, text will scroll across beam depending on the direction specified with setScroll. If setMode(MOVIE) is called before the 'play' method, each frame will appear as you're if flipping through a book. To summarize, setting SCROLL will take each frame and scroll it across the Beam grid whereas setting MOVIE will take each frame and make it 'appear' on the Beam grid one at a time. 

Displaying Custom Animations

The 'draw' function makes it possible to create custom animations and lighting effects. Beam has 35 frames that can be used for this purpose. Think of frames as a page in a book - we can flip through the pages and create animations. In the frames.h file, each frame of the Beam LED matrix is replicated with bytes. Let's take a single frame as an example: 

int frame1[0x0F] = {
0b10000000, 0b00000000, 0b00000001,
0b11111111, 0b00000000, 0b11111111,
0b10000000, 0b00000000, 0b00000001,
0b10000000, 0b00000000, 0b00000001,
0b10000000, 0b00000000, 0b00000001,
};

Each frame array is oriented just like the Beam 5x24 grid - there are 5 rows and 24 bits across. Each bit represents an LED - 1 is on and 0 is off. So if we ignore the '0b' portion that's used to indicate a bit pattern, the first row on Beam would look like '10000000 00000000 00000001' in the example above. The first and last LED on the first row would be on and the remainder will be off. The second row would have the first 8 and last 8 LEDs on and the middle 8 LEDs will be off. The same applies to the rest of the rows (5 total). This way, we can edit each frame and use all 35 frames. You can use this to create an animation of bouncing 8-bit ball or a flying spaceship or even custom lighting effects for a bike light!

 

Phew. That covers the basics. We know that's a lot of settings -- best way is to go ahead and change some of the values and see what appears on Beam! For more advanced controls, read on.

 

 

Beam Library - Advanced Features

Coming soon.