Lap Average HR, Speed, Power & Cadence

Hi all,

I would like to develop a 4 datafield to display Speed, HR, Power and Cadence average of current lap.

If i use info.averageHeartRate i get average from the begin of the activity, so here is my question : How can i get this data only from the beginning of the current lap ?

Thx
Mc
  • With a data field, you can user onTimerLap() to see when a lap occurs, and based on that, calculate the average until the next onTimerLap().

    Calculate the data in compute() and not in onUpdate(), as compute runs once every second, even if the DF isn't visible, where onUpdate() only runs if you are on the data screen with that DF, and can run more than once if the field is used twice on the same data screen (you can see this in the sim where the DF is shown in all the available fields if using a multi field layout)
  • Thx you very much for your quick answer, I will dig this way and let you know if I succeed. Br McEwans
  • There are a few other things you'll want to consider, like only do the averaging after the recording starts, and maybe discount the readings while the recording is paused.
  • As part of my Performace Dashboard data field for cycling, when you tap the LAP button this displays with stats related to the Lap you just completed. That pop-up disappears after 20 seconds and returns to the full-screen view. The llap's stats are also written to the log file (if you've created the TXT file on the device).

    This is an example from yesterday's ride for a 5.65-mile segment on some rolling hills.

    You could just as easily show this for the CURRENT lap.