Digistump Forums
The Oak by Digistump => Oak Support => Topic started by: actuino on February 07, 2016, 09:08:11 am
-
Hi,
Got my oaks udated and running.
I'm trying a very simple Temp/Humidity sensor.
Config : Oak Core 0.9.2, Arduino 1.6.7 on Win8 64 bits.
Noticed that
double temp=0;
[...]
Particle.variable("temp",temp);
Does not compile :
undefined reference to `bool CloudClass::variable<particle_core::CloudVariableTypeDouble>(char const*, particle_core::CloudVariableTypeDouble::varref, particle_core::CloudVariableTypeDouble const&)'
Using the old interface
Particle.variable("temp", &temp, DOUBLE);
doesn't compile either.
Particle.publish() , however, works fine.
I did a double to *char conversion and used publish() for the time being.
-
Hey @actuino,
Seeing a similar thing here too (using Mac OSX is my case) - in fact, Strings and char * don't seem to work either - only int is working fine for me (see my sample code here:
https://github.com/ajpowell/OakSamples/blob/master/examples/oak_particle.variable/oak_particle.variable.ino (https://github.com/ajpowell/OakSamples/blob/master/examples/oak_particle.variable/oak_particle.variable.ino) )
Not seeing the functions in the OakParticle.cpp file for Double - mind you, seeing the ones for String and char * and that doesn't work, so something not quite right here.
As a workaround, you could send the value as an integer i.e. your double value *10 for 1 decimal place or double value * 100 for 2 decimal places - not ideal though...
-
Opened issue for this: https://github.com/digistump/OakCore/issues/25
Looking into it
Thanks for the report!