Is there anyone who could help beginner check code of one datafield I created?

I have some basic understanding of how coding works but never have I developed anything. 
With the help of Copilot in VS Code and my basic knowledge I tried to create a simple datafield called AltiDelta. I will add the DF outline below. 
However I am experiencing so many errors when compiling. Mostly related to monkey.jungle and manifest.xml files. 
Is there anyone who would be willing to check my code??

AlitDelta DF outline:
.
1) simple datafield that shows (in real time) altitude difference between device current altitude and altitude at the start of an activity or start a of lap (provided lap button is pressed) and current altitude.
Here is example: I start my hike in 100 m above the sea level. I will climb to 150 m and so the data field will show "+50 m". when I press lap button the number will reset to 0 because it will record current altitude at lap start and therefore there will be no difference in altitude at the lap press button until I move to a different altitude during the lap.
2) altitude difference can be (obviously) negative, positive or zero.
3) the data field updates the data every second
4) important feature is to save the data to FIT file so that there will be a graph with values visible in Garmin Connect app after the activity is saved.
5) my main devices are Garmin Fenix 8 with MIP screen and Garmin Edge 840 with MIP screen so I wanted to make sure the data field will be optimized for both regular display theme - black text on white background - as well as inverted/dark theme - white text on dark background. 


  • I have built a simple datafield covering your outline which may help to see how it may work...

    Find below a zip file with the project.

    PS: I'm an unskilled hobby developer. There are probably more elegant ways for coding...  ;-)

    AltiDelta_1.zip

  • Thank you for the reply. Is the WF available in Ciq store? Looks like exactly what I was looking for. My code is so different (see the ZIP below) but I really have very basic understanding of coding and was discussing it with Copilot in VS Code. 

  • Is the WF available in Ciq store?

    No, I set it up as an example for you.
    But if your goal is not to understand coding but only have this datafield on your devices - I can upload it to the store. But I have to add some things to make it usable for meters and feet…

  • Hello, , sorry my late reply. I was away from home for a few days. Yes, I wanted to learn the monkey C coding a bit but after a few days staring at the code and with the lack of good tutorials on the web I feel like it would not be so easy. It would be great if you could publish the AltiDelta DF in Ciq store. I would be more than happy to pay for your effort! 

  • Awesome! I tested the data field on the Edge 840 today, and everything seems to be working great. No glitches so far—except for one minor issue: when I swapped the data field’s position on the screen during the ride, AltiDelta started showing the current altitude instead of the difference (with a ±1 m fluctuation, probably due to the per-second calculation). However, pressing the lap button reset the field, and it began calculating the altitude difference again as expected. You can see both swap instances highlighted in the attached graph. I guess this is a bug of the Edge FW and to be honest I never swap data fields on the way...

    This weekend, I’ll test it on the Fenix 8 Solar—hopefully with an altitude gain of over 1000 m (today I only hit the 1xx m range). I’ll report back with my experience!

  • when I swapped the data field’s position on the screen during the ride, AltiDelta started showing the current altitude instead of the difference

    That‘s because the datafield takes the first reference starting elevation (=current elevation) before you start your activity.
    If you swapp the datafield on your screen during a running activity, a new datafield is loaded - but because the activity is running already, the first reference starting elevation is 0 because there was no „time before activity start“.

    I could change that behaviour by setting a flag and taking the first reference starting elevation after pressing the start button.

  • Since our dicussion becomes off topic here, please use the forum‘s link „contact developer“ for further discussions via email!