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 CCS Technical Support

beginner's question

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



Joined: 23 Jun 2008
Posts: 14

View user's profile Send private message

beginner's question
PostPosted: Tue Jul 15, 2008 7:55 am     Reply with quote

I am looking to create a string terminated with a carriage return that I can then send over a SPI transfer. How do I create this string?
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Tue Jul 15, 2008 8:10 am     Reply with quote

Code:
const char error_txt[16] ={"USART overflow\r"};
                                           ^
                                           |
                                           carriage return


note: error_txt[16] ---- 16=14(string) + 1 (\r) + 1 or string termination
also note that sometimes you will need a carriage return line feed

Code:
const char error_txt[17] ={"USART overflow\n\r"};
                                           ^
                                           |
                                           line feed
tom.ayars



Joined: 23 Jun 2008
Posts: 14

View user's profile Send private message

PostPosted: Tue Jul 15, 2008 8:19 am     Reply with quote

treitmey,

thank you much!
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