Author Topic: Particle.variable() doesn't compile  (Read 2011 times)

actuino

  • Newbie
  • *
  • Posts: 2
Particle.variable() doesn't compile
« 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

Code: [Select]
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
Code: [Select]
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.

ajpowell

  • Newbie
  • *
  • Posts: 11
Re: Particle.variable() doesn't compile
« Reply #1 on: February 07, 2016, 03:19:30 pm »
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 )

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...

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Particle.variable() doesn't compile
« Reply #2 on: February 07, 2016, 05:41:19 pm »
Opened issue for this: https://github.com/digistump/OakCore/issues/25

Looking into it

Thanks for the report!