Good day.
I am trying to create an animation with the LED Matrix - Serial Interface RGB with backpack from Sparkfun. http://www.sparkfun.com/products/760
My code knowledge is still very low, so I have pulling Code from the RGBMatrixDemo.pde, deleting different sections to try and get what I want to work.
Here is a link to the tutorial from Sparkfun, with the RGBMatrixdemo.pde in the RGBMatrix Library.
http://www.sparkfun.com/tutorials/201
I am trying to create an animation with 10 different frames. In this code i have input what I am trying to get for the first frame, but am having some issues.
- seems as if matrix is unaligned, the rows and columns do not seem to be matching up to what i think they are.
2.the corner LED which should be (0,0) is intermittently flashing a purple tone of LED, not sure where it is comming from in code. This same light is happening in the unedited version of RGBMatrixdemo.pde.
here is video for visual.
Thanks any help greatly appreciated.
//Define how many LED matrices are connected to create the frame.
int NUM_BOARDS = 1;
//Colors are defined in the RGB.h file
//Creating an array of the colors makes them easier to cycle through. Read the rest of the sketch to see how this is done.
char colors[8] = {BLACK, RED, GREEN, BLUE, ORANGE, MAGENTA, TEAL, WHITE};
void setup()
{
delay(5000); //The matrices won't start accepting data for 5 seconds after they are powered up.
RGBMatrix.begin(NUM_BOARDS); //Start the communication with the LED matrices.
}
void loop()
{
//Put the image onto the frame.
RGBMatrix.display();
delay(1000);
//This section uses the fillRow function to fill the frame with differnt colors row by row.
//Repeat this section for each color in the 'colors' array.
{
//Fill the frame 1 row at a time.
{
//Fill the row on every board in the frame.
for(int board=0; board<NUM_BOARDS; board++)
{
RGBMatrix.fillPixel(board,0,0,RED);
RGBMatrix.fillPixel(board,0,3,RED);
RGBMatrix.fillPixel(board,0,4,RED);
RGBMatrix.fillPixel(board,1,7,RED);
RGBMatrix.fillPixel(board,1,1,RED);
RGBMatrix.fillPixel(board,1,6,RED);
RGBMatrix.fillPixel(board,2,2,RED);
RGBMatrix.fillPixel(board,2,3,RED);
RGBMatrix.fillPixel(board,3,3,RED);
RGBMatrix.fillPixel(board,3,4,RED);
}
//Update the display each time we add a row.
RGBMatrix.display();
delay(1000);
}
//After adding all of the rows to the frame, we want to remove them.
//We can 'remove' a row by coloring the row with black.
//Add a black row to the frame 1 row at a time
{
//Add the black row to the entire frame.
for(int board=0; board<NUM_BOARDS; board++)
{
RGBMatrix.fillScreen(board, BLACK);
}
//Update the display with the 'removed' row.
RGBMatrix.display();
delay(50);
}
}
}