i made a 10 x 5 led matrix display using pic18f2550 and 10 bc548 transistor for 10 columns (negative supply) and 5 bc548 and 5 bc557 coupling for 5 rows(positive supply). positive supply is from a lm317 ic its the basic hardware
pic is configured as 8 bit internal oscillator without prescaler for better row scanning
i made into each led is x y addressable and working fine i can liight any led using x and y positions of the matrix
i can show characters or any thing but the problem is with scrolling messages
am using mplapbs c18 compiler so please give me the correct code using x and y positions from left to right or right to left
I had the function "display( x , y)" and "x" represent each column(0 to 9) and "y" represents each row(0 to 4)
for displaying characters am using the below function
Code:
void showtext(void )
{
// i want to show the word "STOP" only so no input for function
unsigned char x = 0;
unsigned char y = 0;
unsigned char currentCol;
int tmpCol = 0;
int tmpRow = 0;
Clear(); // a function which putting all leds off
for (currentCol = 0; currentCol< 10; currentCol++)
{
if (tmpCol < 4)
{
// Display a single column
if ((MyFontLib[tmpCol][tmpRow] & 0b00000001) != 0) display(x, y);
y++;
if ((MyFontLib[tmpCol][tmpRow] & 0b00000010) != 0) display(x, y);
y++;
if ((MyFontLib[tmpCol][tmpRow] & 0b00000100) != 0) display(x, y);
y++;
if ((MyFontLib[tmpCol][tmpRow] & 0b00001000) != 0) display(x, y);
y++;
if ((MyFontLib[tmpCol][tmpRow] & 0b00010000) != 0) display(x, y);
y =y- 4;
x++;
}
tmpRow++;
if (tmpRow == 4)
{
tmpRow = 0;
tmpCol++;
}
}
}
my font lib is here
Code:
// total 4 columns for each character
//character taking first 3 columns and one column blank to create space between characters
const unsigned char MyFontLib[][4] = {
0x17,0x15,0x1d,0x00, //s
0x01,0x1f,0x01,0x00, //t
0x1f,0x11,0x1f,0x00, //o
0x1f,0x05,0x07,0x00, //p
};
please help me to update this code
i just want to scroll the characters from left to right and from right to left