Is there a way to capture accelerometer/gyroscope values?

Lawrence 7 years ago updated by icahill (Administrator) 7 years ago 7
Is there an action similar to an event listener on when the device move?

Was able to achieve this by using javascript within functions.html:


I was able to retrieve the value from [eval:getValueG()] from an action (such as from an onclick event).

Only thing I can think of is having a loop with [eval:getValueG()] constantly running.
Are there other methods/techniques to achieve like results?

I'm new and trying out it out.

Any help appreciated. Thanks!
seem like code snippet was filtered out. added image.
fyi, if you use <code> blocks in the comments, WIRE will display.

Like this:


<!-- datasources go here -->



<!-- styles go here -->



<!-- classes go here -->



<!-- main wire hierarchy -->



<!-- actions go here -->

In wire engine 1.4 you can use [system:orientation] to return the current orientation of the device. You can also trigger an action using ondevicerotate="NAMEOFACTION" to fire when an orientation change is detected.

I hope that helps!
I was hoping to get contant values when device is still moving.
Assuming you are on a MBP, put this line within your browser's console

window.ondeviceorientation = function(event){console.log(event.gamma);}

You should see logs with values when you move your MBP.

I am trying to achieve this type of logging within rarewire.
For now JS is probably the best approach for something that unique. I would be happy to add a feature request to look into adding this to WIRE.
I see. Wasn't sure if there were something like this exist.
This idea was asked form the creative group if we detect tilt and found this work around with working w/JS.

Would be great if it mimic ondeviceorientation and ondevicemotion.



Joe Longstreet (Buddy of mine) wrote an article a while back on these values.
I can certainly bring this up in our next dev meeting. Thanks for the interest.