Daily distance value for display on widget - FR235

Hi,
I am creating my first simple widget to totalize the weekly distance covered from history on my FR235 but need to add the distance covered during the current day to make the display value correct. I am using the distance component of the Class: Toybox::ActivityMonitor::Info but it appears to be returning a 0 value while my device is showing a distance has been covered.

I have checked the code is OK by interrogating the stepGoal and a value is returned, so it is pointing to my use of the distance variable.

Could anyone tell me if this distance component in Class: Toybox::ActivityMonitor::Info is OK to use on the FR235 or is there an alternative method of getting the current daily distance. Do I need to calculate it using the Number of steps * step Length

Many Thanks
  • Hi,
    I am creating my first simple widget to totalize the weekly distance covered from history on my FR235 but need to add the distance covered during the current day to make the display value correct. I am using the distance component of the Class: Toybox::ActivityMonitor::Info but it appears to be returning a 0 value while my device is showing a distance has been covered.

    I have checked the code is OK by interrogating the stepGoal and a value is returned, so it is pointing to my use of the distance variable.

    Could anyone tell me if this distance component in Class: Toybox::ActivityMonitor::Info is OK to use on the FR235 or is there an alternative method of getting the current daily distance. Do I need to calculate it using the Number of steps * step Length

    Many Thanks


    This is weird. I am sure you are using the correct one as it is exactly what I am using in my watch faces.
    You don't need to calculate it. It should return the value in cm, which you can then convert to km or miles.

    Check what you get in the simulator when simulating Activity Monitoring?
  • This is weird. I am sure you are using the correct one as it is exactly what I am using in my watch faces.
    You don't need to calculate it. It should return the value in cm, which you can then convert to km or miles.

    Check what you get in the simulator when simulating Activity Monitoring?


    Thanks for the reply HermoT. The Simulator also did not update the distance field and even when I loaded the widget to the device with real data available there was no update. I went for my run this afternoon and to my surprise the distance field updated. I am unsure if this is as a result of an activity being done and the data refreshed but it is all up and running.

    Many Thanks again - Just got to sort an arc progress bar and I may have completed my first widget ..