Obviously I could have a huge list of If's or a case statement but I don't like either of options much
- Battery Status -Voltage: [%1]VTemperature: [%2]C
char strFromFile = " - Battery Status -\nVoltage: %sV\nTemperature: %sC"; //normally in your file...char dest;sprintf( dest, strFromFile, BatVolts, BatTemp );...
strreplace( strFromFile, "[BatVolts]", BatVolts);...
#define ReplaceKeyword(keyword) strreplace(strFromFile, "["#keyword"]", keyword)ReplaceKeyword( BatVolts );...
When stepping through the file I would want to replace [BatVolts] with the contents of of the char array BatVoltrs.
I discovered that dtostrf works for floats, I think because the implementation of floats and doubles is the same for the Arduino IDE.
Is there a way to reference one variable with another?
QuoteI discovered that dtostrf works for floats, I think because the implementation of floats and doubles is the same for the Arduino IDE. No. It's because when you pass a float to a function that expects a double, the float gets a temporary promotion (to double).
print "Temperature is:", getTemperature();print "Pressure is:", getPressure();...
The usual naming convention says that math type rounds that ends in 'f' take float arguments, I would imagine dtostrf takes a float as an argument
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16