I've added the OneWire and DallasTemperature libraries found on the WebIDE to my project. I'm trying to port the same code I'm using on my UNO to the Spark to no avail. I've been slowing uncommenting part by part of my code and hit a wall.
Here's the error I got:
onewireexample.cpp:3:19: error: variable or field 'printAddress' declared void
void printAddress(DeviceAddress deviceAddress);
onewireexample.cpp:3:19: error: 'DeviceAddress' was not declared in this scope
onewireexample.cpp:4:23: error: variable or field 'printTemperature' declared void
void printTemperature(DeviceAddress deviceAddress);
onewireexample.cpp:4:23: error: 'DeviceAddress' was not declared in this scope
onewireexample.cpp:5:22: error: variable or field 'printResolution' declared void
void printResolution(DeviceAddress deviceAddress);
onewireexample.cpp:5:22: error: 'DeviceAddress' was not declared in this scope
onewireexample.cpp:6:16: error: variable or field 'printData' declared void
void printData(DeviceAddress deviceAddress);
onewireexample.cpp:6:16: error: 'DeviceAddress' was not declared in this scope
make: *** [onewireexample.o] Error 1
What the heck is going on? The line that's really confusing me is
Something is wrong with the include for the Dallas temperature library–you are not getting any of the included things you need like the typedef for DeviceAddress.
As a work-around, you can try to use the circle plus to add the .cpp and .h files to your sketch on the web IDE.
// This #include statement was automatically added by the Spark IDE.
#include "spark-dallas-temperature/spark-dallas-temperature.h"
I’ve actually tried that and I get the same problem. Any other ideas?
I actually figured it was a typedef issue so I added the type def to the .ino file. I don’t know if you are “allowed” to do this but it didn’t work anyway.