Go Down

Topic: serial.print shows wrong float numbers (Read 920 times) previous topic - next topic

robtillaart

#5
Feb 04, 2013, 06:42 pm Last Edit: Feb 04, 2013, 06:58 pm by robtillaart Reason: 1
Quote
on WIN7 everything is OK, on Win XP floating numbers are wrong.

Amazing!

- do you upload the sketch again or just connect the Arduino?
- which IDE version are on WIN7 / XP?

- Can you try this sketch on both machines? (just upload it once)
Code: [Select]

float pi=3.14159265;

void setup()
{
 Serial.begin(115200);

 for (int i = 0; i < 8; i++)
 {
   Serial.println(pi, i);
 }
 Serial.println();
}

void loop()
{
}
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

UKHeliBob

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

robtillaart

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

UKHeliBob

No problem.  Nothing compared to some howlers that I have posted.
Luckily I had a spare int here so was able to run the code and I can confirm that it works as expected for me.
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

robtillaart

I did not test it, just "spit out" the code in one stream, but thanks for confirming that it does what it should do.

These kind of minimal test sketches are useful when debugging the Arduino core
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up