file:///usr/share/arduino/reference/String.html
char* myStrings[]={"This is string 1", "This is string 2", "This is string 3",
"This is string 4", "This is string 5","This is string 6"};
void setup(){
Serial.begin(9600);
}
void loop(){
for (int i = 0; i < 6; i++){
Serial.println(myStrings[i]);
delay(500);
}
}
--
hello people, be gentle
taking that example from the reference
I can Serial print the strings one at a time as above
and can lcd.print to 20x4 screen
but my strings are more than 20 chars and of course wrap to the next line plus one
I don't want to use String object/type, or String.substring, I hit some upper size limit with 20 40 character strings,
and it uses lots of memory
I'm only interested in a single member of the array, take say myStrings[5]
containing 'This is string 5'.
I don't want to serial or lcd print it yet.
I want to assign it to a variable, another character array containing the individual letters
through which I can then loop
for (byte i=0 ; i<20 ; i++) {lcd.print otherVar[i]}
and at the start of the subsequent screen line after setting cursor
for (byte i=20 ; i<39 ; i++) {lcd.print otherVar[i]}
I can do Serial.println(myStrings[i], or mylcd.println(myStrings[i]
but how to simply do like char otherVar[]=myStrings[i] (doesn't work for me) and get the equivalent of {'T', 'h', 'i', 's', ' ', 'i', 's' ...}
I'm sure I had this working before in an earlier edit of something but must have just got lucky. I've discovered some stuff in 'you topic is similar too' that might have an answer, but as I'm here might as well say hi
anyone help, thanks, tom