Adafruit: 8x8 Yellow LED Matrix Panel

From eLinux.org
Revision as of 13:18, 17 October 2012 by Yoder (talk | contribs) (Overview)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Overview


Overview: 2
Wiring:   2, nice clear picture
Code:     2, nice animation
git/Compiles with make: 2  make works
Demo:     2
Total:    10
Comments: Looks good. Maybe you could post a video to YouTube and put a link here.

The adafriut 8*8 yellow Led matrix has been used in my mini project 2. I'm using it to display some simple pattern, Chinese characters and even some simple animation.

The code of the project is modified from the sample code provided by Dr. Yoder. And my code has been commited to my github: The github repository of Xinyu Cheng.

Here is a display sample of the Led Matrix:

Display Sample.JPG

Hardware Connection

To ensure the matrix works properly, we need to connect the four pins in the device to the Beagle Bone. Here is a picture for the connection:

Hardware Connection.jpg

As we can see in the picture, the VCC and GND are connected to the VCC and GND in the Bone. And the data pin is connected Pin D18, which is I2C2_SDA. Connect the clock pin to Pin D17, which is I2C2_SCL. After the above connection, the hardware part is done.

Software Design

The mainly work of the software here is to display the correct pattern. And the pattern can be depicted through write a correct value (1 or 0) to each LED in the matrix. 1 means the LED is on and 0 means the LED is off.

For example, the pattern of ❤ can be displayed through the array:

Heart_bmp[]={0x0C, 0x1E, 0x3E, 0x7C, 0x3E, 0x1E, 0x0C, 0x00};

I have write a function to implement the display:

//The Function to Display a BMP.
int display(__u16 bmp[], int res, int daddress, int file)
{     
    int i;     
    for(i=0; i<8; i++)      
    {	block[i] = (bmp[i]&0xfe) >>1 |  
        (bmp[i]&0x01) << 7;     
    }     

    res = i2c_smbus_write_i2c_block_data(file, daddress, 16, 	   
    (__u8 *)block);     

    usleep(400000);
}

The codes for the whole project can be found in my github: Codes for Mini Project 2.

Demo Pictures of Display

I desired to upload a video here. However the file type is prohibited. So, the only method I can show my work here is through the pictures:

The Matrix Display I.JPG

The Matrix Display Love.JPG

The Martix Display U.JPG

That's my introduce to the Led Matrix. Hope you can have an enjoy experience while using the device.