Windows Phone 8.1 - Week5 Tuesday - Smart Embedded System Lab Kookmin University 1
Objectives and what to study Training 1: To Get Accelerometer Sensor Value Training 2: To Get Compass Sensor Value To Get Compass Sensor Value Training 3: To Get Gyrometer Sensor Value To Get Gyrometer Sensor Value 2
Objectives Sensor of Windows Phone Behind source code programing What to study How to get accelerometer sensor value How to get compass sensor value How to get gyrometer sensor value 3
Windows Phone sensors Windows Phone supports multiple sensors that allow apps to determine the orientation and motion of the device Accelerometer Measuring the forces applied to the device at a moment in time Compass (Magnetometer) Determining the angle by which the device is rotated relative to the Earth s magnetic. Gyroscope Determining the rotational velocity of the device in each axis Ambient Light Sensor Windows Phone Sensor Fusion 4
To Get Accelerometer Sensor Value Lab 5
Training 1: To Get Accelerometer Sensor Value Using Accelerometer Sensor 6
Create a New Project File -> New Project -> Project 7
New Project New Project Window Template -> Visual C# -> Store App -> Windows Phone App 8
New Project New Project Window Framework:.Net Framework 4.5 9
New Project New Project Window Empty App(Windows Phone) 10
New Project Name: Accelerometer 11
The Created Project 12
Solution Explorer MainPage.xaml 13
Layout MainPage.xaml 14
Layout 1 st Row TextBlock Text= Accelermeter 2 nd Row TextBlock Text= X = 3 rd Row TextBlock Text= Y = 4 th Row TextBlock Text= Z = 5 th Row Button Content= Start 15
Layout Completing the Layout Source Code 16
Button Click Event Double Click Button control of Layout View 17
Behind Source code To Declare Local Variable 18
Behind Source code MainPage() 19
Behind Source code To Add DisplayCurrentReading() Method 20
Behind Source code Filling up button event method 21
Setting up target Device 22
Building and Run on the Windows Phone Build -> Solution Build 23
Building and Run on the Windows Phone Debug -> Start without debugging 24
Ready for installing app to Windows phone 25
Training Application Test 26
To Get Compass Sensor Value Lab 27
Training 2: To Get Compass Sensor Value Using Compass Sensor 28
Create a New Project File -> New Project -> Project 29
New Project New Project Window Template -> Visual C# -> Store App -> Windows Phone App 30
New Project New Project Window Framework:.Net Framework 4.5 31
New Project New Project Window Empty App(Windows Phone) 32
New Project New project window Name : CompassSensor 1 CompassSensor CompassSensor 2 33
The Created Project 34
Solution Explorer MainPage.xaml 35
Layout MainPage.xaml 36
Layout 1 st Row TextBlock Text= Compass 2 nd Row TextBlock Text= Magnetic = 3 rd Row TextBlock Text= True = 4 th Row Button Content= Start 37
Layout Completing the Layout Source Code 38
Layout To Add Button Event 39
Behind Source Code To Add Sensors Library and Declare Local Variable 40
Behind Source Code 41
Behind Source Code Filling up button event method 42
Behind Source Code To add DisplayCurrentReading() method 43
Setting up target Device 44
Building and Run on the Windows Phone Build -> Solution Build 45
Building and Run on the Windows Phone Debug -> Start without debugging 46
Ready for installing app to Windows phone 47
Training Application Test 48
To Get Gyrometer Sensor Value Lab 49
Training 3: To Get Gyrometer Sensor Value Using Gyrometer Sensor 50
Create a New Project File -> New Project -> Project 51
New Project New Project Window Template -> Visual C# -> Store App -> Windows Phone App 52
New Project New Project Window Framework:.Net Framework 4.5 53
New Project New Project Window Empty App(Windows Phone) 54
New Project New project window Name : Gyrometer 1 Gyrometer Gyrometer 2 55
The Created Project 56
Layout MainPage.xaml 57
Solution Explorer MainPage.xaml 58
Layout 1 st Row TextBlock Text= Gyrometer 2 nd Row TextBlock Text= X = 3 rd Row TextBlock Text= Y = 4 th Row TextBlock Text= Z = 5 th Row Button Content= Start 59
Layout Completing the Layout Source Code 60
Layout To Add Button Event 61
Behind Source Code To Add Sensors Library and Declare Local Variable 62
Behind Source Code MainPage() 63
Behind Source Code To Write Button Event Method 64
Behind Source Code To add ReadingChanged() method 65
Setting up target Device 66
Building and Run on the Windows Phone Build -> Solution Build 67
Building and Run on the Windows Phone Debug -> Start without debugging 68
Ready for installing app to Windows phone 69
Training Application Test 70