Should dtostrf work with simulator?

This forum is for all topics related to Simulator for Arduino v0.98. Please include sample code where possible.

Moderator: Adrian

juho
Posts: 7
Joined: Tue Mar 05, 2013 8:09 am

Should dtostrf work with simulator?

Postby juho » Sun Apr 14, 2013 8:10 am

Hi,
I'm working on to get my existing Arduino code compatible with simulator. I have been using dtostrf to convert float to string. I found dtostrf command seems not return anything in simulator. Is there an easy work-around for this? Maybe another simulator-friendly command for conversion?

BR,
Juho

float analog_value = 12.3;
char analog_string[5];

void setup() {
Serial.begin(9600);
dtostrf(analog_value, 4, 1, analog_string);
Serial.print("analog value is: ");
Serial.print(analog_value);
Serial.print(", and string is: ");
Serial.println(analog_string);
}

void loop() {
}

User avatar
Adrian
Super user
Posts: 56
Joined: Thu Jan 10, 2013 10:22 pm

Re: Should dtostrf work with simulator?

Postby Adrian » Sun Apr 14, 2013 11:51 pm

Hi Juho,

This is a new function on me.

See http://playground.arduino.cc/Main/FloatToString etc.
and http://arduino.cc/forum/index.php?topic=103935.0

Kind regards
Adrian
Apologies for being opinionated - it's nothing personal, feel free to complain.
usual system: Pro V0.98 Arduino Mega 2560 Samsung i5-3210M 2.5Ghz 6GB windows home premium SP1


Return to “Version 0.98”

Who is online

Users browsing this forum: No registered users and 1 guest