Grove - RGB LED Matrix w/Driver examples

Grove is a modulated, ready-to-use tool set.
Much like Lego, it takes a building block approach to assembling electronics.

Moderators: violet, jeremy882, crail.lyu969

Post Reply
greg.tuthill
Pre-kindergarten
Pre-kindergarten
Posts: 2
Joined: Sun Jan 06, 2019 5:12 am

Grove - RGB LED Matrix w/Driver examples

Post by greg.tuthill » Fri Jan 25, 2019 5:59 am

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

xianning.lan
Pre-kindergarten
Pre-kindergarten
Posts: 20
Joined: Fri Sep 28, 2018 3:35 pm

Re: Grove - RGB LED Matrix w/Driver examples

Post by xianning.lan » Wed Jan 30, 2019 2:20 pm

Hi Greg,

Some emojis inside the firmware of RGB LED Matrix.

Best Regards,
Blu

User avatar
designnotes.com
Pre-kindergarten
Pre-kindergarten
Posts: 10
Joined: Mon Jan 28, 2019 11:08 pm
Location: Philadelphia, PA
Contact:

Re: Grove - RGB LED Matrix w/Driver examples

Post by designnotes.com » Fri Feb 01, 2019 6:41 pm

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:
http://wiki.seeedstudio.com/Grove-RGB_L ... river/#diy


I hope it will help you.

Thank you.

greg.tuthill
Pre-kindergarten
Pre-kindergarten
Posts: 2
Joined: Sun Jan 06, 2019 5:12 am

Re: Grove - RGB LED Matrix w/Driver examples

Post by greg.tuthill » Tue Feb 12, 2019 5:02 am

Thanks, that makes sense.

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

Thanks,
Greg

Post Reply