kirangowle
Member level 3
- Joined
- Apr 6, 2010
- Messages
- 65
- Helped
- 3
- Reputation
- 6
- Reaction score
- 3
- Trophy points
- 1,288
- Location
- Bangalore
- Activity points
- 1,632
void main ()
{
clk=0;
Data=0;
OE=0;
OE=1;
while(1)
{
Data=1;
P1=0x7F; // 7F to glow single col LEDs(0111 1111)
clk=1;
delay(2);
clk=0;
Data=0;
//P1=0x00; // to glow single col LEDs(0000 0000)
clk=1;
delay(20);
clk=0;
Data=1;
P1=0x70; // 70 to glow single col LEDs(0111 0000)
clk=1;
delay(2);
clk=0;
for(z=0;z<59;z++)
{
Data=0;
//P1=0x00; // 7F to glow single col LEDs(0111 1111)
clk=1;
delay(20);
clk=0;
}
}
}
0 0 1
0 0 1
0 0 1
0 0 1 and it will be keep on scrolling from left to right
1 0 1
1 0 1
1 0 1
0 0 0
0 0 0
0 0 0
0 0 0 and it will be keep on scrolling from left to right
1 0 1
1 0 1
1 0 1
void scroll() interrupt 1
{
TL0=0xFE; //Reloading Timer0 For static display.
TH0=0xFF;
P1=0x08;
shift_int(1);
P1=0x01;
shift_int(0);
}
void shift_int(unsigned char temp)
{
unsigned char i;
clk=0;
Data=0;
OE=0;
for(i=0;i<10;i++)
{
clk=0;
Data=temp;
clk=1;
// Data=0;
}
OE=1;
clk=0;
Data=0;
}
void main ()
{
TMOD=0x11; //Intialize Timer 0
TL0=0x00; //Reloading Timer0
TH0=0x00;
IE=0x82; // Enable Timer 0 interrupt
TR0=1; //Start Timer 0
clk=0;
Data=0;
OE=0;
OE=1;
while(1)
{
;
}
}
#include<reg51.h>
sbit clk=P2^0; //serial clock pin
sbit Data=P2^1; //serial data pin
sbit OE=P2^2;
sbit OP= P3^7;
int c=0;
int i,j ;
int x,y;
int z;
unsigned char code table3[]={
0x3E,0x4D,0x53,0x1D,0x1E,0x80,// @
0x7C,0x12,0x11,0x12,0x7C,0x80,// A
0x7F,0x49,0x49,0x49,0x36,0x80,// B
0x3E,0x41,0x41,0x41,0x22,0x80,// C
0x7F,0x41,0x41,0x22,0x1C,0x80,// D
0x7F,0x49,0x49,0x49,0x41,0x80,// E
0x7F,0x09,0x09,0x09,0x01,0x80,// F
0x3E,0x41,0x49,0x49,0x7A,0x80,// G
0x7F,0x08,0x08,0x08,0x7F,0x80,// H
0x80,0x41,0x7F,0x41,0x80,0x80,// I
0x20,0x40,0x41,0x3F,0x01,0x80,// J
0x7F,0x08,0x14,0x22,0x41,0x80,// K
0x7F,0x40,0x40,0x40,0x40,0x80,// L
0x7F,0x02,0x0C,0x02,0x7F,0x80,// M
0x7F,0x04,0x08,0x10,0x7F,0x80,// N
0x3E,0x41,0x41,0x41,0x3E,0x80};// O
void shift_int(unsigned char temp);
void scroll() interrupt 1
{
TL0=0xFF; //Reloading Timer0
TH0=0xFF;
shift_int(1);
for(i=0;i<=60;i++)
{
P1=table3[i];
shift_int(0);
}
}
void shift_int(unsigned char temp)
{
unsigned char i;
clk=0;
Data=0;
OE=0;
for(i=0;i<1;i++)
{
clk=0;
Data=temp;
P1=0x00; // To avoid ghosting effect.
clk=1;
//Data=0;
}
OE=1;
clk=0;
Data=0;
}
void main ()
{
TMOD=0x11; //Intialize Timer 0
TL0=0x00; //Reloading Timer0
TH0=0x00;
IE=0x82; // Enable Timer 0 interrupt
TR0=1; //Start Timer 0
clk=0;
Data=0;
OE=0;
OE=1;
while(1)
{
;
}
}
while(1)
{
k=0;
IE=0x92;
y=0;
Totcol=60; // No of column
temp=0;
do
{
if(over==1)
{
shift_int(1);
for(w=0;w<=Totcol;w++) // Clear the Display by sending 80.
{
P0=0x80;
shift_int(0);
}
Totcol--; // For shifting display one position at a time.
for(x=0;x<cnt;x++)
{
c=table((msg_data[x]&0xf0)>>4);
d=c+(6*(msg_data[x]&0x0f));
for(i=0;i<6;i++) // to read the display data from table
{
P0=*d++;
shift_int(0);
}
}
for(w=0;w<temp;w++) // Again filling space after the msg displayed.
{
P0=0x80;
shift_int(0);
}
temp++;
if(Totcol==-2){ // -2 is for to reach till first col
Totcol=60;
}
DelayMs(20); // tune this according to hardware
over=0;
}
}
while(!NewMessage); // New msg recd flag
for(i=0;i<15;i++)
{
msg_data='\0';
}
IE=0x00;
temp=read_notification();
NewMessage=0;
k=0;
}
}
void scroll() interrupt 1
{
TL0=0x00; //Reloading Timer0
TH0=0xFF;
over=1;
}
void shift_int(bit temp)
{
OE=0;
clk=0;
Data=temp;
P0=0x00;
clk=1;
OE=1;
clk=0;
Data=0;
}
By design of your code, I think. What do you intend else?But when it reaches the left most wall(col) as soon as 'A' touches the Left most col entire display would start again.
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?