Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

calculator shift left style in keil c

Status
Not open for further replies.

lgeorge123

Full Member level 2
Full Member level 2
Joined
Jun 13, 2004
Messages
130
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Location
Hong Kong
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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top