Pages: [1]   Go Down
Author Topic: I can't parse this data into float  (Read 563 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a char data from serial of arduino. each data seperated by comma. the sample shown below.

12.02020,210.125454,10.12,1

I use parseFloat() to seperate each to array but the seperated data in array is only 2 digit decimal.

How to solve this problem? I tried for 5 days but I can't fond the solution.
Logged

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

How do you know the data in the array is only 2 decimal places?
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I use Serial.print() command
Logged

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

And do you tell the Serial.print command to print more than 2 decimal places?
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I got it. Thank you for your help

Serial.println(values);

it works!

Logged

Pages: [1]   Go Up
Jump to: