I’m working on a project where I am sending some data from mobile app in the form of String via BLE (CC41-A) to Arduino Uno. In arduino the string is divided into small strings and the small strings are then converted to double for some mathematical calculation. The original string is in the format (Ex: 23.54, 108.67; 56.85, 45.75; … so on). And the smaller strings are created inside loop as follows:
the string segment before comma (,) is converted to double and stored in variable x &
the string segment before semi colon ( is converted to double and stored in variable y
For double conversion I’m using string.toDouble(). But the first ‘x’ value shows right (in this ex: x=23.54) using that function and gives 0.00 on subsequent conversions for ‘x’. The ‘y’ value always returns right.
I’ve attached the code. I can’t figure out why only the ‘x’ value is printed wrong. Pls help…
XY_Plotternew.ino (2.34 KB)