Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pebble docs #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions pebble.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,55 @@ This script demonstrates pebble click events, setting text in the view, vibratio
</body>
</html>


You can also subscribe to pebble gestures.

.. code-block:: html

<html style="width:100%; height:100%; overflow:hidden">
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<script>
function main() {
if (WS.scriptVersion(1)) return;
WS.subscribe("gesture:pebble:singleClick:UP", function () {
WS.control('SWIPE_LEFT');
});
WS.subscribe("gesture:pebble:singleClick:DOWN", function () {
WS.control('SWIPE_RIGHT');
});
WS.subscribe("gesture:pebble:singleClick:SELECT", function () {
WS.control('TAP');
});
WS.subscribe("gesture:pebble:longClick:SELECT", function () {
WS.control('SWIPE_DOWN');
});
}
window.onload = main;
</script></body></html>

API
===

pebbleSetTitle(String text, boolean clear) : void
Set the title text area on the pebble view.

pebbleSetSubtitle(String text, boolean clear) : void
Set the subtitle text area on pebble view.

pebbleSetBody(String text, boolean clear) : void
Set the body text area on pebble view.

:text(string): text to display on pebble
:clear(boolean): boolean to clear other text areas (true clears all other text areas)

pebbleVibe(int vibeType)
Vibrate pebble.

======== =======
Type Value
======== =======
short 0
long 1
double 2
======== =======

1 change: 1 addition & 0 deletions sensors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Sensors have unique names and integer types that are used internally and can be
=================== =======
Type Value
=================== =======
pebble -7
pupil -2
gps -1
accelerometer 1
Expand Down