CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

String!!!

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
soulweed



Joined: 20 Oct 2006
Posts: 23

View user's profile Send private message

String!!!
PostPosted: Thu Mar 29, 2007 11:30 am     Reply with quote

I am using PIC18F452

i need to spilt a string.
Ex. "CA12.5" or "CI22.3"

I need to get A for Command type and 12.5 is value of type A.
Code:

void hw_uart_isr (){
char rs232_temp;   

           rs232_temp = fgetc(CH1);

                  Temp_Command[next_in]=rs232_temp;
                        
                     if (rs232_temp==0x0d){
                     next_in=0;
                     ptr= strchr(Temp_Command,'C');
                        
                     Command = *(Temp_Command+1);
                     Ctemp[0]= *(Temp_Command+2);
                     Ctemp[1]= *(Temp_Command+3);
                     Ctemp[2]= *(Temp_Command+4); //Must be " . "         
                     Ctemp[3]= *(Temp_Command+5);
                      Ctemp[4]= 0x00;
                     
                     switch (Command){
                            case 'A' :
                            ...
                            ....
                            case 'I' :
                            ...
                 }



Ctemp=12.5
command=A
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Mar 29, 2007 12:03 pm     Reply with quote

http://www.ccsinfo.com/forum/viewtopic.php?t=27121&highlight=mid+string
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group