Puck.js previous value storage #3304
Unanswered
espruino-discuss
asked this question in
Puck.js, Pixl.js, Jolt.js and MDBT42
Replies: 2 comments
-
|
Posted at 2020-03-18 by Robin Tue 2020.03.17 Hello @user110429, Is the above snippet from this example perhaps? (last code snippet) Maybe populate an array with each value read, then perform the comparrison calculation after it is known there won't be any more data? > https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array If walking an array to extract a value is not your cup of tea, then there are 'Try it' examples at my favorite simple test site: > https://www.w3schools.com/js/js_arrays.asp Would you mind posting some data output, and of course a made up example of how/what is desired to be viewed. That would assist us in providing some ideas. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Posted at 2020-03-18 by @gfwilliams You can use However the magnetometer value will depend on what orientation you're in, so really it'd make more sense to do something like have a buttonpress 'reset' the zero value, so you can just press it before you start doing exercise. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2020-03-17 by user110429
Hi all,
I'm working on a project where I use the puck.js to keep track of reps based on the difference of the starting value returned by the magnetometer and the elevated value when users complete a rep.
Currently I'm using a hardcoded value for comparison, but I don't like this approach. I want to be able to either read the previous value obtained by the magnetometer or at least get some help with storing the value for later use.
Any help is much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions