twisterss / ArduinoLEDMatrixPong

Arduino Sure Electronics 32x16 bi-color LED matrix library and pong example
5 stars 1 forks source link

Sure Electronics 32x16 bi-color LED matrix Arduino library

The display library

Principle

This library makes very easy to control the Sure Electronics 32x16 bi-color LED matrix using an Arduino.

It works using a local buffer: draw all you want in the local buffer using the clear() and draw(x, y, color) functions. Once you are done, send only the parts which have changed to the screen using the render() function.

A much more powerful, generic and complicated library to manage the LED matrix is available here (with text, shapes and bitmaps support). An even more powerful one for HT1632C chips is here.

Installation

The library is made of only 2 files:

Add both files to your sketch directory and add this line on top of your sketch:

#include "led_matrix.h"

Then you can use the LEDMatrix class provided by the library. Read the .h file for more information.

The pong example

The pong example is based on the one found here on Arduino Education. The principles for writing the display library were also found on this page.

It is a bit improved:

The circuit to build is almost the same as on the version here. You just need to add one more potentiometer (on A2 by default) to set the ball speed.