I need help in converting my x,y,z value from double to char.
1. Assume DUE which supports 64-bit binary64 (IEEE-754 Standard) format for floating point number. It gives 12/13 digit accuracy after decimal point.
2. Assume: double x = 3.1415926;
3. Execution of --
String storage = String(x, 7); results in having:
storage[0] = 0x33 //ASCII code of 3
storage[1] = 0x2E //ASCII code of .
.....................................................
storage[8] = 0x36 //ASCII code 6
storage[9] = 0x00 //ASCII code of null-byte (null character)
4. Let us check:
Serial.println(storage); //shows: 3.1415926
Serial.println(storage[0], HEX); //shows: 33 = ASCII code of 3
..................................................
Serial.println(storage[9], HEX); //shows: 0 = ASCII code of null character