-
-
Save IT-Delinquent/de333e5f5820353a8f82724f27367cd7 to your computer and use it in GitHub Desktop.
garminSimpleWatchFaceExample.mc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get and show the current time | |
var clockTime = System.getClockTime(); | |
var timeString = Lang.format("$1$:$2$", [clockTime.hour, clockTime.min.format("%02d")]); | |
updateDisplayObject("TimeLabel", timeString); | |
//Get and show the current battery percentage | |
var pwr = System.getSystemStats().battery; | |
var batStr = Lang.format( "$1$%", [ pwr.format( "%2d" ) ] ); | |
updateDisplayObject("BatteryPercentageLabel", batStr); | |
//Get and show the steps data | |
var stepCountString = ActivityMonitor.getInfo().steps.toString(); | |
updateDisplayObject("StepsLabel", stepCountString); | |
//Get and show the date | |
var now = Time.now(); | |
var info = Calendar.info(now, Time.FORMAT_LONG); | |
var dateString = Lang.format("$1$ $2$ $3$", [info.day_of_week, info.day, info.month]); | |
updateDisplayObject("DateLabel", dateString); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment