Project 20 - An LED Matrix (Bridging )

<< Click to Display Table of Contents >>

Navigation:  Projects >

Project 20 - An LED Matrix (Bridging )

This project uses the MikroElectronica 8x8 LED Click to create the dot matrix animations. Any one of the four different animations is selectable via the buttons on the CleO50 display.





This project uses the following component(s) -


Mikroe 8X8 LED Click



Hardware Setup


The picture below shows the LED 8X8 Click is connected to MikroE Click 2 interface.


Project 20 - LED Matrix (Bridging)-HW Setup





The Setup() routine sets up the CleO50 display and configures the MAX7219 LED driver on the 8x8 Click to "no decode" operation as shown in the below code snippet -


/* Initializes CleO and the 8x8 Matrix (MAX7219) to "normal mode" */

void setup()



   uint8_t handle = (uint8_t)CleO.OpenSPI(Bridge::interfaces::CleO50_click_2, 1000000);

   H = handle;

   Click.Initialize(WRITE, true);

/* Initialize the CleO display */



 State = TAG_PACMAN; /* default selection is PACMAN */



The loop() routine monitors the touch events until a particular animation button is selected. Each animation is an independent state which loops continuously until the user selects a new animation. The currently selected button is rendered as a "flat" button. The setjump() and longjump() functions are used to return to the loop() if a touch event is detected in any of the animation states.


void loop()


 setjmp(jump_buffer); /* Jump here on detecting a new touch */

 clear_martix(); /* Start from a clear state */

 update_cleo(State); /* Update CleO display */

 /* Run animations on the LED matrix */

 if(State == TAG_PACMAN) run_pacman();

 else if (State == TAG_SPIRAL) run_spiral();

 else if(State == TAG_ALIEN) run_aliens();

 else if(State == TAG_STRING) run_string();

 else get_touch();



Bitmaps for all the images displayed on the 8x8 LED matrix are stored as arrays in the Arduino program memory to save SRAM. Each bitmap is 8 bytes in length, with each bit corresponding to a LED in the matrix. For example, the bitmap for a Pacman image is shown below -


const uint8_t PROGMEM pacman[] =











Similarly fonts are also stored in the program memory, each character requires 8 bytes of storage. For example the letter 'X' looks like this:















Project 20 LEDClick