Grove - RGB LED Matrix w/Driver examples

Hi all,



I have been playing with the Grove - RGB LED Matrix w/Driver examples and have these successfully working on a Particle photon. Yay!



There are a bunch of examples and im trying to understand where the source of the pattern is actually stored.



For example the “displayEmoji” sample code which scrolls through a whole bunch of emojis has the following in the loop:



matrix.displayEmoji(i,5000,true);



so far so good. but where is the acutual array that makes up the emojis?



looking in the .cpp file there is:



void GroveTwoRGBLedMatrixClass::displayEmoji(uint8_t emoji, uint16_t duration_time, bool forever_flag)

{

uint8_t data[5] = {0, };



data[0] = I2C_CMD_DISP_EMOJI;

data[1] = emoji;

data[2] = (uint8_t)(duration_time & 0xff);

data[3] = (uint8_t)((duration_time >> 8) & 0xff);

data[4] = forever_flag;



i2cSendBytes(currentDeviceAddress, data, 5);

}



and in the .h file:



#include <Arduino.h>

#include <Wire.h>



#define I2C_CMD_DISP_EMOJI 0x02 // This command displays emoji



// /*************************************************************

// * Description

// * Display emoji on LED matrix.

// * Parameter

// * emoji: Set a number from 0 to 29 for different emoji.

// * 0 smile 10 heart 20 house

// * 1 laugh 11 small heart 21 tree

// * 2 sad 12 broken heart 22 flower

// * 3 mad 13 waterdrop 23 umbrella

// * 4 angry 14 flame 24 rain

// * 5 cry 15 creeper 25 monster

// * 6 greedy 16 mad creeper 26 crab

// * 7 cool 17 sword 27 duck

// * 8 shy 18 wooden sword 28 rabbit

// * 9 awkward 19 crystal sword 29 cat

// * 30 up 31 down 32 left

// * 33 right 34 smile face 3

// * duration_time: Set the display time(ms) duration. Set it to 0 to not display.

// * forever_flag: Set it to true to display forever, and the duration_time will not work.

// * Or set it to false to display one time.

// * Return

// * Null.

// *************************************************************/

void displayEmoji(uint8_t emoji, uint16_t duration_time, bool forever_flag = false);



but where is the actual array that makes up the image. I’m expecting to see something like this:



uint64_t example[] = {



0xffff5e5e5e5effff,

0xff5effffffff5eff,

0x5eff5effff5eff5e,

0x5effffffffffff5e,

0x5eff5effff5eff5e,

0x5effff5e5effff5e,

0xff5effffffff5eff,

0xffff5e5e5e5effff,



0xffff29292929ffff,

0xff29ffffffff29ff,

0x29ff29ffff29ff29,

0x29ffffffffffff29,

0x29ff29292929ff29,

0x29ffffffffffff29,

0xff29ffffffff29ff,

0xffff29292929ffff,



0xffff00000000ffff,

0xff00ffffffff00ff,

0x00ff00ffff00ff00,

0x00ffffffffffff00,

0x00ffff0000ffff00,

0x00ff00ffff00ff00,

0xff00ffffffff00ff,

0xffff00000000ffff

};



Any clues or help much appreciated!



Cheers

Greg

Hi Greg,



Some emojis inside the firmware of RGB LED Matrix.



Best Regards,

Blu

Hi,



The emojis are stored in the firmware of the driver and when you call it from the code it gets the emoji data via I2C communication.



void GroveTwoRGBLedMatrixClass::displayEmoji(uint8_t emoji, uint16_t duration_time, bool forever_flag)

{

uint8_t data[5] = {0, };



data[0] = I2C_CMD_DISP_EMOJI;

data[1] = emoji;

data[2] = (uint8_t)(duration_time & 0xff);

data[3] = (uint8_t)((duration_time >> 8) & 0xff);

data[4] = forever_flag;



i2cSendBytes(currentDeviceAddress, data, 5);

}



If you want to display your custom emoji then you can follow this DIY part:

<LINK_TEXT text=“http://wiki.seeedstudio.com/Grove-RGB_L … river/#diy”>http://wiki.seeedstudio.com/Grove-RGB_LED_Matrix_w-Driver/#diy</LINK_TEXT>





I hope it will help you.



Thank you.

Thanks, that makes sense.



Do you know if the driver firmware is open source? Where might i find it?



Thanks,

Greg