Upload
blake-horn
View
213
Download
0
Embed Size (px)
Citation preview
Building Sensor-based Apps Windows PhoneWindows Store
Windows Desktop
Tim Binkley-Jonesmanning.com/binkley
Sky Map for Windows PhoneSkyMap is an amazing planetarium for your windows phone. It enables you to point your phone at the sky and see what stars, constellations, planets or deep space objects are out there in real time.
HERE City LensSimply hold up your phone as though taking a photo, and HERE City Lens overlays the best shops, restaurants and points of interest right on your display.
Image taken from the MSDN article “Windows Phone API reference”http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff626516(v=vs.105).aspx
Available Sensors
• Camera, Microphone • Geolocator• LightSensor• Accelerometer, Gyrometer• Compass, Inclinometer, OrientationSensor
For more details, see the MSDN article titled “Managed desktop apps and Windows Runtime”
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\ .NETFramework\v4.5\Facades\System.Runtime.dll
Member Type Description
GetDefault Method A static factory method that returns a sensor instance.
GetCurrentReading Method Returns a read-only object containing the currently available sensor data.
ReadingChanged Event An event raised when ever the current reading changes.
ReportInterval PropertySpecifies how often the sensor reads new data. The data returned by the GetCurrentReading will only change once every time interval.
MinimumReportInterval PropertyA read-only value specifying the smallest value that can be passed set in the ReportInterval property.
Accelerometer
public sealed class AccelerometerReading{ public double AccelerationX { get; } public double AccelerationY { get; } public double AccelerationZ { get; } public DateTimeOffset Timestamp { get; }}
The acceleration along the each axis in g’s.
Gyrometer
public sealed class GyrometerReading{ public double AngularVelocityX { get; } public double AngularVelocityY { get; } public double AngularVelocityZ { get; } public DateTimeOffset Timestamp { get; }}
The angular velocity, in degrees per second, about each axis.
Compass
public sealed class CompassReading{ public double HeadingMagneticNorth { get; } public double? HeadingTrueNorth { get; } public DateTimeOffset Timestamp { get; }}
Heading - the angle between the magnetic field, and the direction the device is pointed
Inclinometer and Orientation Sensor
public sealed class OrientationSensorReading{ public SensorQuaternion Quaternion { get; } public SensorRotationMatrix RotationMatrix { get; } public DateTimeOffset Timestamp { get; }}
public sealed class InclinometerReading{ public float PitchDegrees { get; } public float RollDegrees { get; } public float YawDegrees { get; } public DateTimeOffset Timestamp { get; }}
Rotation around each access
Rotation matrix and quaternion