How can I get the rotation change by Magnet xyz value ? #1840
Replies: 4 comments
-
Posted at 2017-01-04 by Bennr @user72031 You could have a look at this thread http://forum.espruino.com/conversations/297915/ |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-04 by tc Thanks! ... Sadly...I still don't get it, should I just .. var r = Puck.mag(); seems not like this ? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-04 by Bennr I have just updated a thread where I was asking the same question http://forum.espruino.com/comments/13395796/ That will show you how to get the approximate readings (0 is North, -90 is West, 90 is East and 180 is South), so you will be able to use them in the rest of your code. I'd be interested to see it posted, good luck! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-04 by ClearMemory041063 See if this helps |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-04 by tc
Hi all!
I want to make a volume control by rotation the Puckjs.
basically I want to get the angle value change once use press and rotate the Puck,
if the value large than a preset value, I call a volume up and then
reset and wait for another value pass.. I also need to know every time user rotate left or right..
I got xyz from the magnet sensor but I am not sure what to do next.
I did some search on the sin cos tan.. its quite complicate for me..
any hints ? thanks!!!
Beta Was this translation helpful? Give feedback.
All reactions