function onStart(state) System.println("Depth Alert Feature Started");

using Toybox.Application; using Toybox.WatchUi; using Toybox.System; class DepthAlertsApp extends Application.AppBase

class DepthAlertView extends WatchUi.View function onUpdate(dc) var depth = Sensor.getDepth(); if (depth != null && depth < 5) System.println("Shallow water!"); WatchUi.requestUpdate();

function getInitialView() return [ new DepthAlertView() ];

function initialize() AppBase.initialize();

Google検索
Recommend
こちらの記事もどうぞ
記事URLをコピーしました