Advertisement
pedroadmn

Sensor - Xiaomi

Apr 12th, 2016
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MXML 2.75 KB | None | 0 0
  1.                             <!-- Basic Tutorial -->
  2.  
  3. <!-- You can bind the sensor data to the variables for gravity sensor, orientation sensor,
  4. acceleration sensor, linear acceleration sensor and pressure sensors(altitude) -->
  5.  
  6. <!-- Example: -->
  7.  
  8.     <VariableBinders>
  9.     <!--   Orientation sensor:
  10.            type = "orientation"
  11.            index = 0: azimuth, from 0 to 359, 0 = North, 90 = East, 180 = South, 270 = West.
  12.            index = 1: pitch angle, -180 ~ 180, z-axis steering y-axis positive direction
  13.            index = 2: roll angle, -90 ~ 90, x-axis steering z axis positive direction -->
  14.    
  15.         <SensorBinder type = "orientation">
  16.             <Variable name = "orientation_x" index = "0" />    
  17.             <Variable name = "orientation_y" index = "1" />
  18.             <Variable name = "orientation_z" index = "2" />
  19.         </SensorBinder>
  20.  
  21.     <!--   Linear acceleration
  22.            type = "linear_acceleration"
  23.            index = 0: x direction of linear acceleration
  24.            index = 1: y direction of linear acceleration
  25.            index = 2: z direction of linear acceleration
  26.            Linear acceleration is to remove the influence of gravity:
  27.                  * linear acceleration = acceleration - acceleration due to gravity-->
  28.  
  29.         <SensorBinder type = "linear_acceleration">
  30.             <Variable name = "linear_acceleration_x" index = "0" />
  31.             <Variable name = "linear_acceleration_y" index = "1" />
  32.             <Variable name = "linear_acceleration_z" index = "2" />
  33.         </SensorBinder>
  34.  
  35.     <!--   Acceleration
  36.            type = "accelerometer"
  37.            index = 0: x direction acceleration
  38.            index = 1: y direction acceleration
  39.            index = 2: z direction acceleration -->
  40.        
  41.         <SensorBinder type = "accelerometer">
  42.             <Variable name = "acceleration_x" index = "0" />
  43.             <Variable name = "acceleration_y" index = "1" />
  44.             <Variable name = "acceleration_z" index = "2" />
  45.         </SensorBinder>
  46.  
  47.     <!--   Gravity sensor
  48.            type = "gravity"
  49.            index = 0: gravitational acceleration in the x direction
  50.            index = 1: gravitational acceleration in the y direction
  51.            index = 2: gravitational acceleration in the z direction -->
  52.        
  53.         <SensorBinder type = "gravity">
  54.             <Variable name = "gravity_x" index = "0" />
  55.             <Variable name = "gravity_y" index = "1" />
  56.             <Variable name = "gravity_z" index = "2" />
  57.         </SensorBinder>
  58.  
  59.     <!--   Pressure sensor
  60.            type = "pressure"
  61.            index = 0: barometric pressure unit hPa. The average air pressure at sea level is 1013.25hPa,
  62.                       it can be estimated based on the barometric pressure altitude. -->
  63.      
  64.         <SensorBinder type = "pressure">
  65.             <Variable name = "pressure" index = "0" />
  66.         </SensorBinder>
  67.  
  68. </VariableBinders>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement