Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
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
25 changes: 25 additions & 0 deletions apps/gesturelock/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Gesture Lock

## WARNING: Might rewrite any current AI models on your watch!

Uses a pre-trained machine learning gesture model to lock the bangle.

If you want to record some data to be trained in the next version of the model for greater gesture compatibility, or want to see new gestures / features, go to the discussion here: [Discussion](https://github.com/orgs/espruino/discussions/7808)

This app is intended to see what AI models can run on the Bangle.js, and how it can help users daily.
## Gestures

* Twist wrist outward - Locks the Bangle.js
* Agitate - Back? TBD





## Creator

- RKBoss6

## Data Collectors
- Bobrippling
- Thyttan
35 changes: 35 additions & 0 deletions apps/gesturelock/boot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
var locked=false;

function lock(){

if(!locked){
E.stopEventPropagation && E.stopEventPropagation();

Bangle.setLocked(true);

const backlightTimeout = Bangle.getOptions().backlightTimeout; // ms

// seems to be a race/if we don't give the firmware enough time,
// it won't timeout the backlight and we'll restore it in our setTimeout below
Bangle.setOptions({ backlightTimeout: 20 });

setTimeout(() => {
Bangle.setOptions({ backlightTimeout });
}, 300);
}
}
Bangle.on('aiGesture',(gesture)=>{
print(locked);
print(gesture);
if(gesture=="TwistOut"){

lock();

}
});


Bangle.on('lock', function(isLocked) {
locked=isLocked;
});

Binary file added apps/gesturelock/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions apps/gesturelock/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"id": "gesturelock",
"name": "Gesture Lock",
"shortName":"AI Lock",
"icon":"icon.png",
"version":"0.01",
"description": "Uses an AI model to detect a gesture that locks the Bangle",
"type":"bootloader",
"tags": "tool",
"supports": ["BANGLEJS","BANGLEJS2"],
"readme":"README.md",
"storage": [
{"name":"gesturelock.boot.js","url":"boot.js"},
{"name":".tfmodel","url":"model.lite"},
{"name":".tfnames","url":"tfnames.txt"}
]
}
1 change: 1 addition & 0 deletions apps/gesturelock/model.js

Large diffs are not rendered by default.

Binary file added apps/gesturelock/model.lite
Binary file not shown.
1 change: 1 addition & 0 deletions apps/gesturelock/tfnames.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Agitate,TwistOut