I’ve just made my first app for the Suunto Ambit range of watches (I have an Ambit 2), and thought I’d jot down some notes which might prove helpful to anyone else wanting to do the same. Points of note are…
- Suunto call the language “App Script”.
- There is a programming Guide from Suunto here: http://content.static.movescount.com/downloads/SuuntoAppZoneDeveloperManual.pdf
- Your “app” code is run once per second on the watch.
- As far as I can tell, variables are created and destroyed each time the code runs; there is no persistence of variables between executions. This means that you can’t count events over multiple code runs, for example – everything must be calculated from first principles each time.
- The only variable types available for you to use are integer, float and datetime. These are defined using buttons on the website rather than within the code.
- The only output you can give from your code is a number (int or float) or a time. You must pass this by assigning its value to the ‘
RESULT‘ variable, i.e.
RESULT = 100;
- You also get six alphanumeric characters of text to play with in the output, split anywhere from ‘six before the result’ to ‘six after the result’ or anything in-between (e.g. three before and three after). You can change these labels in your code using
postfix="mystri"(that’s right – ‘
postfix‘. I think Suunto made that word up; seems to me that ‘suffix’ is what they meant).
- There is no concept of “settings” for an app, so you cannot allow your users any kind of interaction to specify any times, numbers, etc. which may be relevant. You have to just hard-code with values you think will appeal to the majority of people. [As an aside, this leads to the existence of automatic code generators such as Ambit Intervals, which creates App Script code based on an individual user’s requirements.]
- You can test the app on the website, by playing around with sliders to represent changing values.