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

Adds an isWorn method to the Bangle class #2264

Closed
wants to merge 4 commits into from
Closed

Conversation

splch
Copy link

@splch splch commented Sep 7, 2022

discussion: http://forum.espruino.com/conversations/379538/

I haven’t tested the function, but does the object returned by getAccel allow C-style structure field calls? I call .mag but don’t know if that’s okay.

@gfwilliams
Copy link
Member

does the object returned by getAccel allow C-style structure field calls?

I'm afraid not... you have to use a jsv... method to access JsVar objects. To test this in your branch I believe as long as you enable GitHub actions for your repo, Bangle.js firmware will automatically be built (or attempted - in this case it would fail) and the files are available for you to download.

Actually when I said library I was thinking that rather than building it into the firmware you'd just add a JavaScript library in https://github.com/espruino/BangleApps/tree/master/modules - sorry for the confusion.

Problem with doing it this way is everyone would have to update their firmware before it was available - and if you ever needed to change the values it'd require another firmware update.

I've just added a library for you at https://github.com/espruino/BangleApps/blob/master/modules/wear_detect.js but initial tests show it could do with a bit of work - closing this PR for now.

@gfwilliams gfwilliams closed this Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants