calculator shift left style in keil c

Status
Not open for further replies.

lgeorge123

Full Member level 2
Joined
Jun 13, 2004
Messages
130
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Location
Hong Kong
Visit site
Activity points
1,403
I wish to use 8052 to display ks0108 glcd , also wish to display char in effect of shift left style like calculator when pressing key , I search the web but no result is found , can someone give me some hits ?
 

Sure
Code:
void StringMoveLeft (char * String, char Len)
{
        char tmp;
        char dat = String[0];
        char cnt;
        if (Len) tmp = Len-1;
                else tmp = StringLen(String)-1;
        for (cnt=0; cnt!=tmp; cnt++) String[cnt]=String[cnt+1];
        String[tmp]=dat;
}

void StringMoveRight (char * String, char Len)
{
        char tmp;
        char dat;
        char cnt;
        if (Len) tmp = Len-1;
                else tmp = StringLen(String)-1;
        dat = String[Len-1];
        for (cnt=tmp; cnt!=0; cnt--) String[cnt]=String[cnt-1];
        String[0]=dat;
}
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…