Good morning
My LCD shield don't support yet 'String' object.
I'm waiting a new library from the supplier.
There is any way to convert 'String' to 'char' ?
Thanks on advance
Best regards
Pedro Ferrer
Good morning
My LCD shield don't support yet 'String' object.
I'm waiting a new library from the supplier.
There is any way to convert 'String' to 'char' ?
Thanks on advance
Best regards
Pedro Ferrer
In C a string is an array of chars terminated with the null char.
My LCD shield don't support yet 'String' object.
It is not the shield that does supporting it is the compiler in the Arduino environment. If you upgrade to the latest release you will find that it does support strings without a library.
Hello Grumpy
I have Arduino 0019 version.
The error is really from lcd...
..\Codino1.pde:981: error: no matching function for call to 'LCD4Bit_mod::printIn(String&)'
..\arduino/LCD4Bit_mod.h:12: note: candidates are: void LCD4Bit_mod::printIn(char*)
Best regards
Pedro Ferrer
I have Arduino 0019 version.
Down load the latest version, from 20 it contains strings.
Hello
Thanks Grumpy, but the last version is 21... I thought that the last was 19...
I'll try.
Best regards
Pedro Ferrer
but the last version is 21... I thought that the last was 19
Well generally the number 20 is between 19 and 21. It is the version I downloaded only last week. But go for 21.
Hello
Version 0019 already have String class.
Best regards
Pedro Ferrer
Hello
Version 0021 installed.
Problem remains...
..\Codino1.pde:981: error: no matching function for call to 'LCD4Bit_mod::printIn(String&)'
..\cores\arduino/LCD4Bit_mod.h:12: note: candidates are: void LCD4Bit_mod::printIn(char*)
I'm waiting new library for LCD shield.
Best regards
Pedro Ferrer
I Tried v19 and stuff stopped working so im back on 018 and all's working again, incidently sprintf(output,"modifier",input) is a very usefull function
You can extract the character array from the String object using the toCharArray method. Look at the header file for the String class. The web page for the toCharArray function is wrong.
The class String published in WString.h as delivered with Arduino 0021 has the operator const char *() commented out in WString.h. So all you've got are the function toCharArray and getBytes. But those two function do an internal strncpy and you need to provide a temporary buffer.
As it is, the class String delivered by WString is a disgrace and shouldn't have been delivered. Avoid it, use the C-like str... from strings.h functions instead or get another String class that is properly designed.
Korman