I have a double variable double tempTime1; and I want to expose it to read from the API Spark.variable("tempTime1", &tempTime1, double); and I get the following compiler error
powertarget.cpp: In function 'void setup()':
powertarget.cpp:124:43: error: expected primary-expression before 'double'
Aha! yes, while double and DOUBLE both say that you want a variable that is floating point, they are not the same thing - there’s a key difference:
DOUBLE tells the spark cloud what the type of the variable is - the information is accessible to your program.
double tells the compiler to allocate space for a floating point variable. This information is not accessible to your program (your program can’t ask - what’s the type of this variable? - the compiler assumes you know.)
So you see that double is used to allocate the variable to begin with. while DOUBLE has to be used to register the variable to the cloud,