+1
Beantwortet

Is there a way to capture accelerometer/gyroscope values?

Lawrence vor 12 Jahren aktualisiert von icahill (Administrator) vor 12 Jahren 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:
[code]

[/code]

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:


<wire>
<datasources>

<!-- datasources go here -->

</datasources>

<styles>

<!-- styles go here -->

</styles>

<classes>

<!-- classes go here -->

</classes>

<main>

<!-- main wire hierarchy -->

</main>

<actions>

<!-- actions go here -->

</actions>
</wire>
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.

Info:
http://developer.apple.com/library/sa...

http://developer.apple.com/library/sa...

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