I'm working on a (complex) datafield for the Edge 1000 and one thing I'd like to display is the temperature from the internal sensor.
I've read conflicting things about whether this is even possible - ie that it can be done but you must create a background process that runs every five minutes or something... but all this information is a few years old so I'm not sure if anything has changed.
One issue I'm having with anything I try is that I get a pair of "Permission required" errors when I attempt to run the app in the simulator. I have enabled the permissions in the manifest (Background, Sensor History, and Sensor).
In the initialize function declaration I'm also enabling the sensors like so:
function initialize() {
DataField.initialize();
Sensor.setEnabledSensors([Sensor.SENSOR_TEMPERATURE]);
Sensor.enableSensorEvents(method(:onSensor));
mValue = 0.0f;
speed = 0.0f;
batteryPercent = 0;
temperature = 0;
}
What am I doing wrong here? Is there anything that can even be done to achieve what I'm looking for, or is it impossible to get the temperature in a custom data field on the Edge 1000?