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
Info: MIAC (Arduino) type MI5466
Convert from char to float format
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
- Contact:
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: Convert from char to float format
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.
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.
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
- Contact:
Re: Convert from char to float format
Hi LeighM
Thanks for the answer.
Trying to search the Arduino again on solution;-)
Thanks for the answer.
Trying to search the Arduino again on solution;-)
Best Regard
Monie
Monie
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: Convert from char to float format
OK, hope it helps.
Otherwise i could possibly add some functions to the MIAC library to return clock parameters as integers - next week.
Otherwise i could possibly add some functions to the MIAC library to return clock parameters as integers - next week.
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
- Contact:
Re: Convert from char to float format
Hi LeighM
Do you help with add some functions til MIAC library to return clock parameters as integers?
Do you help with add some functions til MIAC library to return clock parameters as integers?
Best Regard
Monie
Monie