https://www.edaboard.com/threads/221384/
is a good start, this is some stuff for the Tri-color (Sure's again) LED Panels.... I Got "super Alexan'd" for offering to share the code, so I cut and paste a load of code to try and make him go away... If you let me know what setup you have, we'll work out some crazy stuff for you mate!! The 16f723 demo-board that is "made for the job" of controlling the LED's is a bit lame (but still cool as fork) in that it has little memory, RAM or ROM to play with.... I've made 16f88 controlboards instead that work a lot better (384 bytes of RAM! WooHoo!!) but I'm sure whatever setup you have as long as we have an "output buffer" that you can present half my code'll port straight over...
I tend to have a ram buffer for the graphics (can be bit of a waste but helps for certain jobs) of Char[]. I actually have to split it into 4 separate [64] arrays, like my own "Paging" routines... I then use a "PresentToPanelData" (Hi Thinila, recognise this?!!!) that sets up the ram area with the scrolled/waved/etc graphics to be sent to the panels....
[example]
static void PresentToPanelData(unsigned int xPos, unsigned char yPos2 ,unsigned char srcColumn, unsigned char dstCol)
{
static signed char ySinDir=0;
char sinCount=1;
unsigned int xs2 = xStart;
yPos=yPos2;
ySinTmp =0;
if(sinX) ySinDir=1; else {ySinDir=0; ySinTmp=0;}
if(sinX)
{
while(xs2--)
{
if(sinCount--==0)
{
sinCount=1;
ySinTmp += ySinDir;
if(ySinTmp>=SinMax) { ySinDir=-1; }
if(ySinTmp<=SinMin) {ySinDir=1;}
}
}
}
nWhichColumn = ((((yPos )/8) + srcColumn) &3);
nWhichColumn2 = ((((yPos )/8) + 1 + srcColumn) &3);
yPos &= 7;
for(c=0;c<8;c++)
{
yPos =yPos2;
cTemp = 0;
if( (c+xPos) < BitmapLengthTot )
{
if(sinX )
{
if(sinCount--==0)
{
sinCount=1;
ySinTmp += ySinDir;
if(ySinTmp>=SinMax) { ySinDir=-1; ySinTmp=SinMax;}
if(ySinTmp<=SinMin) {ySinTmp=SinMin;ySinDir=1;}
}
yPos =yPos2;
yPos += ySinTmp;
nWhichColumn = ((((yPos )/8) + srcColumn) &3);
nWhichColumn2 = ((((yPos )/8) + 1 + srcColumn) &3);
yPos &= 7;
}
cTemp = bmap[c+xPos][nWhichColumn] >> (yPos);
cTemp |= bmap[c+xPos][nWhichColumn2] << (8-yPos);
PanelData4[c][dstCol] = cTemp;
;
}
else PanelData4[c][dstCol] = 0;
}
for(c=0;c<8;c++)
{
yPos =yPos2;
yPos =yPos2;
if(sinX)
{
if(sinCount--==0)
{
sinCount=1;
ySinTmp += ySinDir;
if(ySinTmp>=SinMax) { ySinDir=-1; ySinTmp=SinMax;}
if(ySinTmp<=SinMin) {ySinTmp=SinMin;ySinDir=sinX;}
}
yPos =yPos2;
yPos += ySinTmp;
nWhichColumn = ((((yPos )/8) + srcColumn) &3);
nWhichColumn2 = ((((yPos )/8) + 1 + srcColumn) &3);
yPos &= 7;
}
cTemp = 0;
if( (8+c+xPos) < BitmapLengthTot )
{
cTemp = bmap[8+c+xPos][nWhichColumn] >> (yPos);
cTemp |= bmap[8+c+xPos][nWhichColumn2] << (8-yPos);
PanelData3[c][dstCol] = cTemp;
}
else PanelData3[c][dstCol] = 0;
}
for(c=0;c<8;c++)
{
yPos =yPos2;
cTemp = 0;
if( (16+c+xPos) < BitmapLengthTot )
{
yPos =yPos2;
if(sinX )
{
if(sinCount--==0)
{
sinCount=1;
ySinTmp += ySinDir;
if(ySinTmp>=SinMax) { ySinDir=-1; ySinTmp=SinMax;}
if(ySinTmp<=SinMin) {ySinTmp=SinMin;ySinDir=1;}
}
yPos =yPos2;
yPos += ySinTmp;
nWhichColumn = ((((yPos )/8) + srcColumn) &3);
nWhichColumn2 = ((((yPos )/8) + 1 + srcColumn) &3);
yPos &= 7;
}
cTemp = bmap[c+xPos+16][nWhichColumn] >> (yPos);
cTemp |= bmap[c+xPos+16][nWhichColumn2] << (8-yPos);
PanelData2[c][dstCol] = cTemp;
;
}
else PanelData2[c][dstCol] = 0;
}
for(c=0;c<8;c++)
{
yPos =yPos2;
if(sinX)
{
if(sinCount--==0)
{
sinCount=1;
ySinTmp += ySinDir;
if(ySinTmp>=SinMax) { ySinDir=-1; ySinTmp=SinMax;}
if(ySinTmp<=SinMin) {ySinTmp=SinMin;ySinDir=1;}
}
yPos =yPos2;
yPos += ySinTmp;
nWhichColumn = ((((yPos )/8) + srcColumn) &3);
nWhichColumn2 = ((((yPos )/8) + 1 + srcColumn) &3);
yPos &= 7;
}
cTemp = 0;
if( (24+c+xPos) < BitmapLengthTot )
{
cTemp = bmap[24+c+xPos][nWhichColumn] >> (yPos);
cTemp |= bmap[24+c+xPos][nWhichColumn2] << (8-yPos);
PanelData1[c][dstCol] = cTemp;
}
else PanelData1[c][dstCol] = 0;
}
}
[/example]
This is good start!!!!
Stay in touch buddy
NEAL