Pages: [1]   Go Down
Author Topic: Strings  (Read 379 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i'm having trouble adding characters to a variable string.  The examples didn't help me much.  It shows how to declare them but not how to manipulate them.

i have a keypad working fine and displaying a random alphanumberic code on the LCD screen. i want save that to a string.  i believe you have to refer to each character in the string when you mod it but i cant get it to work.

 some sample code plz.
Logged

Dallas, Texas
Offline Offline
God Member
*****
Karma: 0
Posts: 861
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I use this excellent library even when there might be a more efficient way to do it because it seems so intuitive to me:

http://www.sundial.org/arduino/index.php/pstring/

Since it derives from Print, you can create strings in a buffer just like you were printing to your LED.

It may be overkill, but I like it.
Logged

Pages: [1]   Go Up
Jump to: