api gyroscope - TouchDevelop

Download Report

Transcript api gyroscope - TouchDevelop

api
gyroscope
measure device rotation rate
Disclaimer: This document is provided “as-is”. Information and views expressed in this document, including URL and other Internet
Web site references, may change without notice. You bear the risk of using it. This document does not provide you with any legal rights
to any intellectual property in any Microsoft product. You may copy and use this document for your internal, reference purposes. ©
2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and Windows Live are trademarks of the Microsoft group of
companies. All other trademarks are property of their respective owners.
touchdevelop api
gyroscope
o
o
o
o
gyroscope sensor determines
rotational velocity of the device in each
axis.
use values obtained from the
gyroscope sensor to determine the
orientation of the device in space
if you are interested in determining the
attitude (yaw, pitch, and roll) of the
device, use Motion
gyroscope sensor is not required for
Windows Phone devices; your phones
do not have it
touchdevelop api
axis
o
see Wikipedia
http://en.wikipedia.org/wiki/Aircraft_principal_axes
touchdevelop api
apis
o
o
Senses→has
gyroscope
Indicates if the
gyroscope is available
on the device
Senses→has motion
Indicates if the motion
can be computed on
the device. Motion
requires
accelerometer,
compass and
gyroscope.
o
o
o
o
o
o
o
Motion→gravity
Gets the gravity vector associated with
this reading.
Motion→acceleration
Gets the linear acceleration of the
device, in gravitational units.
Motion→yaw
Gets the yaw of the attitude in degrees
Motion→pitch
Gets the pitch of the attitude in degrees
Motion→roll
Gets the roll of the attitude in degrees
Motion→rotation speed
Gets the device rotation speed in
degrees per sec.
Motion→time
Gets a timestamp indicating the time at
which the reading was calculated.
touchdevelop api
examples
o
Senses: gyroscope
☁ http://touchdevelop.com/ijck
o
attitude graph
☁ http://touchdevelop.com/otcr
o
gyroscope graph
☁ http://touchdevelop.com/oegfa
touchdevelop api