MD_Cubo LED Cube Arduino Library  2.1
Library to control LED Cubes
Arduino LED Cube Library

LED Cubes

The MD_Cubo library implements methods and a framework that enable the software elements of any monochrome or color LED cube to be easily implemented. This allows the programmer to use the LED matrix as a voxel device addressable through XYZ cartesian coordinates, displaying graphics elements much like any other voxel addressable display.

If you like and use this library please consider making a small donation using PayPal

The Library

The library implements functions that allow LED cubes to be abstracted in software so that underlying hardware changes do not affect the definition and structure of the controlling code.

In this scenario, it is convenient to abstract out the concept of the hardware device and create a uniform and consistent 3D cartesian (XYZ) voxel address space, with the libraries determining device-element address for each LED. Similarly, control of the devices should be uniform and abstracted to a system level.

There appears to be 2 major architectures for implementing cubes:

  1. A 'scanning refresh' model. In this model the LEDs are refreshed by the Arduino at a rate fast enough to activate a persistence of vision (POV) effect.
  2. A 'set and forget' model. In this model the voxel is set by the Arduino and some other hardware ensures that the appropriate LEDs are turned on.

The software must take into account these differences and allow both to work using the same basic software pattern. At a fundamental level, the hardware dependent code required needs to do the following:

  • Initialize the hardware
  • Turn on specific LED (voxel) on or off in the specified color
  • Update the display (internal buffers to actual device)
  • Animate the display (ignored for 'set and forget', refresh for scanning)

The standard library supports several different types of cubes, listed below. To add a new type of hardware architecture, refer to Adding New Cube Types

A word about Axes

To enable user code to work properly a convention related to the orientation of the XYZ axes needs to be implemented in the hardware dependent code.

Decide on a 'bottom' corner to be the origin (0,0,0). This will usually be one of the corners just above the supporting PCB. Orient the cube so one face of the cube is directly towards you and the origin is located in the lower left hand corner.

From this reference point

  • the Z axis is the vertical axis up the cube.
  • the Y axis is the left to right axis you can see.
  • the X axis is the axis in the 'depth' direction of the cube.

Cube Hardware Supported

Revision History

Oct 2020 - version 2.1

  • Added Direct I/O cube
  • Fixed some compiler warnings

Sep 2019 - version 2.0.2

  • Added ICS574 cube

Jul 2018 - version 2.0.1

  • Fixed setVoxel issue with 595 cube

Mar 2018 - version 2.0.0

  • Added color cube support
  • Add Ziffra 4x4x4 color cube based on STC15F2K60S2 with serial interface

Feb 2016 - version 1.1

  • Added jolliCube - first 8x8x8 cube
  • Reorganized library
  • Reorganized and expanded examples
  • Added text based examples, font definition file and related utility functions

Aug 2015 - version 1.0

  • First release

Copyright

Copyright (C) 2015-2019 Marco Colli. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA