bianchi77
Advanced Member level 4
- Joined
- Jun 11, 2009
- Messages
- 1,313
- Helped
- 21
- Reputation
- 44
- Reaction score
- 20
- Trophy points
- 1,318
- Location
- California
- Activity points
- 9,442
Shifting is done inside your display function , increase the delay there so that shifting is done in slower rate.
Alex
void display(unsigned char pat[])
{
unsigned int cnt, col, row, num ;
row = 1;
//for (cnt = num*8 ; cnt < (num*8+8) ; cnt ++ ) //display pattern each character
for (cnt = 0 ; cnt < 8 ; cnt ++ ) //display pattern each character
{
P3 = ~pat[cnt];
P1 = ~row;
[B][COLOR="#FF0000"]delay_ms(10) ; // delay of 1 ms[/COLOR][/B]
row = row<<1;
}
row = 0x00;
}
display(pat);
[B][COLOR="#FF0000"]delay_ms(15000);[/COLOR][/B]
display(pat2);
[B][COLOR="#FF0000"]delay_ms(15000);[/COLOR][/B]
You are currently using
Code:void display(unsigned char pat[]) { unsigned int cnt, col, row, num ; row = 1; //for (cnt = num*8 ; cnt < (num*8+8) ; cnt ++ ) //display pattern each character for (cnt = 0 ; cnt < 8 ; cnt ++ ) //display pattern each character { P3 = ~pat[cnt]; P1 = ~row; [B][COLOR="#FF0000"]delay_ms(10) ; // delay of 1 ms[/COLOR][/B] row = row<<1; } row = 0x00; }
and the red line is the delay you have between each step of the scroll, that is what you need to change.
The other delay
Code:display(pat); [B][COLOR="#FF0000"]delay_ms(15000);[/COLOR][/B] display(pat2); [B][COLOR="#FF0000"]delay_ms(15000);[/COLOR][/B]
is just the delay between showing the first character scroll and the second character scroll.
Alex
Alex,That will only change the delay between different characters so it depends on what you want to do, experiment with different values.
Alex
display(pat2); //display H
display(pat_clear);
delay_ms(50000);
display(pat3); //display E
I put delay_ms(100) ; " inside the loop, should, is it too fast, but if it's too slow, the scan for one character will be too slow...have you increased the delay inside the function , for example use delay_ms(10) or 200 and see the result
display(pat2); //display H
display(pat_clear);
delay_ms(1000);
display(pat3); //display E
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?