I think it uses the column scanning because the consuming is such small.
static bitmaps1 [0x20][5] //32 characters by 5 patterns for a char as the matrix is 7x5
= {
0x32, 0x49, 0x79, 0x41, 0x3e, //@ 0
0x7e, 0x11, 0x11, 0x11, 0x7e, //A 1
0x7f, 0x49, 0x49, 0x49, 0x36, //B 2
and so on.........}
if (flags.ShowTime)
{
//time display not done
if (TimeString[msgScrollCnt])
{
//get the pointer to the time string
glyph_ptr = getglyph(TimeString[msgScrollCnt++], 0);
}
}
void MarqueeDisplay(const byte *DispMsg)
{
byte shift[6] = {0, 0, 0, 0, 0, 0}, j = 0;
shift[0] = *DispMsg++; //buffer the glyph data.
shift[1] = *DispMsg++;
shift[2] = *DispMsg++;
shift[3] = *DispMsg++;
shift[4] = *DispMsg++;
//keep the display in circular motion
do
{
//shiftbuffer(x_top, y_top, x_bot, y_bot, glyph, direction).
shiftbuffer(0, 0, 32, 7, shift + j, shift_left); //scroll left by 1 pixel and insert the appropriate updated pixels.
j++;
}
while (j < 5); //this is the width matrix (7x5 display), change to 8 for 8x8 matrix
}
void scandisplay()
{
static byte scanline = 0;
static byte oddline = 1; //scanning the odd lines first
byte *p, i;
//this routine should be executed every 2ms, if this fails then to prevent
//the display from getting too much current due to missing multiplexer,
//the controller will be reset by the watch dog after 18mS.
CLRWDT();
//blank display to avoid glitches, OE is high at this time
CCP1CON = 0;
RC2 = 0;
ST_CP = 0;
//output bytes here.
for (i = 0; i < MATRIX_COUNT; i++)
{
p = MATRIX[i] + scanline;
#ifdef CA
//send inverted data on the SPI buss for the common anode columns
WRITE_SPI(~(*(p)));
WRITE_SPI(~(*(p + 1)));
WRITE_SPI(~(*(p + 2)));
WRITE_SPI(~(*(p + 3)));
#endif
#ifdef CC
//send out the normal data on SPI for the common cathode columns
WRITE_SPI(*(p));
WRITE_SPI(*(p + 1));
WRITE_SPI(*(p + 2));
WRITE_SPI(*(p + 3));
#endif
//store the new data
ST_CP = 1;
}
//Turn on the selected row
switch (scanline)
{
case 0:
ROW_1();
break;
case 4:
ROW_2();
break;
case 8:
ROW_3();
break;
case 12:
ROW_4();
break;
case 16:
ROW_5();
break;
case 20:
ROW_6();
break;
case 24:
ROW_7();
break;
}
//unblank the entire display
CCP1CON = 0b00001100;;
/*interleaved scanning */
//odd lines are active and scanned first
if(oddline)
{
if(scanline < 24)
scanline += 8;
else
{
oddline = 0;
scanline = 4; //go to first even row that is 2
}
}
else
{
if(scanline < 20)
scanline += 8;
else
{
oddline = 1;
scanline = 0; //go to first odd row that is 1
}
}
/*NORMAL line by line scanning */
// if (scanline < 24 )
// scanline += 4;
// else
// scanline = 0;
}
static bitmaps1 [0x20][5] //32 characters by 5 patterns for a char as the matrix is 7x5
= {
0x32, 0x49, 0x79, 0x41, 0x3e, [COLOR="#FF0000"]0x00[/COLOR] //@ 0
0x7e, 0x11, 0x11, 0x11, 0x7e, [COLOR="#FF0000"]0x00[/COLOR] //A 1
0x7f, 0x49, 0x49, 0x49, 0x36, [COLOR="#FF0000"]0x00[/COLOR] //B 2
and so on.........}
void MarqueeDisplay(const byte *DispMsg)
{
byte shift[6] = {0, 0, 0, 0, 0, 0}, j = 0;
shift[0] = *DispMsg++; //buffer the glyph data.
shift[1] = *DispMsg++;
shift[2] = *DispMsg++;
shift[3] = *DispMsg++;
shift[4] = *DispMsg++;
[COLOR="#FF0000"]shift[5] = *DispMsg++'[/COLOR]
//keep the display in circular motion
do
{
//shiftbuffer(x_top, y_top, x_bot, y_bot, glyph, direction).
shiftbuffer(0, 0, 32, 7, shift + j, shift_left); //scroll left by 1 pixel and insert the appropriate updated pixels.
j++;
}
while (j < [COLOR="#FF0000"]6[/COLOR]); //this is the width matrix (7x5 display), change to 8 for 8x8 matrix
}
void MarqueeDisplay(const byte *DispMsg)
{
byte shift[6] = {0, 0, 0, 0, 0, 0}, j = 0;
shift[0] = *DispMsg++; //buffer the glyph data.
shift[1] = *DispMsg++;
shift[2] = *DispMsg++;
shift[3] = *DispMsg++;
shift[4] = *DispMsg++;
[COLOR="#0000FF"]//shift[5] = *DispMsg++'[/COLOR]
[COLOR="#FF0000"]shift[5] = 0x00;[/COLOR]
//keep the display in circular motion
do
{
//shiftbuffer(x_top, y_top, x_bot, y_bot, glyph, direction).
shiftbuffer(0, 0, 32, 7, shift + j, shift_left); //scroll left by 1 pixel and insert the appropriate updated pixels.
j++;
}
while (j < 6); //this is the width matrix (7x5 display), change to 8 for 8x8 matrix
}
Hi eeye;
Please can you share the source code
best regards
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?