Particle Device OS Updates Thread

API Changes in 0.4.6

Please note that the Particle.variable() API was changed to include stricter checks for variables. If you see a compiler error on code that has previously worked, this is an indication that the code wasn’t calling the API correctly.

For reference, the 3 types of variables are declared like this:

char string_variable[30];  // change 30 to be as large as is needed to store the string value
int int_variable;
double double_variable;

Particle.variable("string", string_variable, STRING);
Particle.variable("int", &int_variable, INT);
Particle.variable("double", &double_variable, DOUBLE);

In particular, you’ll notice that the STRING variable does not need the ampersand (&) in front of the variable name.

4 Likes