Page 1 of 1

Convert from char to float format

Posted: Sat Feb 11, 2017 8:36 am
by Monie Jacobsen
HI everbody
Want to convert char theDate [8]; to float format.
And float = day to show when printing to display eksemple: 23

Has attached Ardino file: MiacCloack.ino
MiacClock.zip
(911 Bytes) Downloaded 384 times
Info: MIAC (Arduino) type MI5466

Re: Convert from char to float format

Posted: Sat Feb 11, 2017 11:29 am
by LeighM
You would need to separate out the day from the date string, using strncpy() then toFloat()
Or toInt() not sure why you need float.
Search these functions in web Arduino reference.

That MIAC example shows how to print the day value one character at a time.

Re: Convert from char to float format

Posted: Sat Feb 11, 2017 12:12 pm
by Monie Jacobsen
Hi LeighM
Thanks for the answer.
Trying to search the Arduino again on solution;-)

Re: Convert from char to float format

Posted: Sat Feb 11, 2017 12:19 pm
by LeighM
OK, hope it helps.
Otherwise i could possibly add some functions to the MIAC library to return clock parameters as integers - next week.

Re: Convert from char to float format

Posted: Sat Feb 11, 2017 4:29 pm
by Monie Jacobsen
Hi LeighM
Do you help with add some functions til MIAC library to return clock parameters as integers?