VHR- easy appl

Hello, I am doing a very easy application in order to shop TIme, altitude and temperature on VH3 sdk2.4.
function initialize() {
AppBase.initialize();
// Position.enableLocationEvents(Position.LOCATION_CONTINUOUS, method(:onPosition));


Sensor.setEnabledSensors( [Sensor.SENSOR_TEMPERATURE] );
Sensor.setEnabledSensors( [Sensor.SENSOR_HEARTRATE] );
Sensor.enableSensorEvents( method( :onSensor ) );

}
----
function onSensor(sensorInfo) {
System.println( "Heart Rate: " + sensorInfo.heartRate );
System.println( "TEmp: " + sensorInfo.temperature );
System.println( "Alt: " + sensorInfo.altitude );
}
the resul is that is

Heart Rate: null
TEmp: null
Alt: -17.998905

Where I am wrong ? :)
  • Do
    Sensor.setEnabledSensors( [Sensor.SENSOR_TEMPERATURE, Sensor.SENSOR_HEARTRATE] );

    to start, Doing it like you did, and the second overrides the first.

    With the Temperature, it will be null unless you have a tempe sensor paired and connected.

    For HR, it will be null unless it has a HR (with Wrist HR, you need to be wearing the watch)
  • Do
    Sensor.setEnabledSensors( [Sensor.SENSOR_TEMPERATURE, Sensor.SENSOR_HEARTRATE] );

    to start, Doing it like you did, and the second overrides the first.

    With the Temperature, it will be null unless you have a tempe sensor paired and connected.

    For HR, it will be null unless it has a HR (with Wrist HR, you need to be wearing the watch)


    I did your suggestion for the init,but the result is still the same. Also the Vivoactive HR has inside the temperature and HR sensor.
  • With sensorInfo (in the code you posted), the only temperature data you get is from a Tempe. You do not see the temperature from the internal sensor.

    To see the internal temperature data, you use SensorHistory.getTemperatureHistory() and look at the newest sample.

    For heart rate, are you wearing the watch when you run this? Or are you just running this in the simulator?

    If you are just running in the sim and want to see it change,go to Simulation>Fit Data and them "Simulate Data". That will also simulate temperature data (as if you had a Tempe)
  • With sensorInfo (in the code you posted), the only temperature data you get is from a Tempe. You do not see the temperature from the internal sensor.

    To see the internal temperature data, you use SensorHistory.getTemperatureHistory() and look at the newest sample.

    For heart rate, are you wearing the watch when you run this? Or are you just running this in the simulator?

    If you are just running in the sim and want to see it change,go to Simulation>Fit Data and them "Simulate Data". That will also simulate temperature data (as if you had a Tempe)


    I understood. Many thanks !!