目的
PebbleにSimply.jsのサンプルアプリをインストールします。
前提
- Pebbleのアプリが最新である事
- Pebbleのファームウェアが最新である事
- WiFiを利用している事
手順
CloudPebbleへログインする
プロジェクトを作成する
「Create」ボタンでProjectを作成します。
サンプルソースを見る
app.jsを参照するとこんな感じになってます。
app.js
console.log('Simply.js demo!');
simply.on('singleClick', function(e) {
console.log(util2.format('single clicked $button!', e));
simply.subtitle('Pressed ' + e.button + '!');
});
simply.on('longClick', function(e) {
console.log(util2.format('long clicked $button!', e));
simply.vibe();
simply.scrollable(e.button !== 'select');
});
simply.on('accelTap', function(e) {
console.log(util2.format('tapped accel axis $axis $direction!', e));
simply.subtitle('Tapped ' + (e.direction > 0 ? '+' : '-') + e.axis + '!');
});
simply.setText({
title: 'Simply Demo!',
body: 'This is a demo. Press buttons or tap the watch!',
}, true);
PebbleのアプリでDeveloper Modeを有効にする
Settingsから有効にし
Enable Developer Connectionsを有効にします。
サンプルアプリをインストールする
CloudPebbleのCompilationから「Install and Run」で、Pebbleにサンプルアプリがインストールされます。
はまった点
「Install and Run」がうまくいかなかったんですが、Pebbleのファームを最新にしたらうまくいきました。