title: Use a gyro/accelerometer with Arduino
body: <p>I've tried <a href="http://arduino.cc/playground/Main/MPU-6050#sketch" rel="noreferrer">this sketch</a> provided by arduino.cc. (I've an <a href="https://rads.stackoverflow.com/amzn/click/com/B008BOPN40" rel="noreferrer" rel="nofollow noreferrer">MPU6050 GY-521 breakout board</a>.)</p>
  
  <p>I think it works fine. It gives a weird set of numbers I can't get any meaning out. It says that those are raw values.</p>
  
  <p>How can I convert them into meaningful values?</p>
  
  <p>The output is as follows. Even when the whole thing is kept stationary, it gives changing values! Is this meaningful? Then how is it to be understood?</p>
  
  <p><em>(What I only know is that the temperature value is meaningful :D)</em></p>
  
  <pre><code>June 2012
  WHO_AM_I : 68, error = 0
  PWR_MGMT_2 : 0, error = 0
  
  MPU-6050
  Read accel, temp and gyro, error = 0
  accel x,y,z: 260, 120, 15572
  temperature: 31.047 degrees Celsius
  gyro x,y,z : -24, -234, -240,
  
  MPU-6050
  Read accel, temp and gyro, error = 0
  accel x,y,z: 304, 12, 15608
  temperature: 31.000 degrees Celsius
  gyro x,y,z : -7, -234, -232,
  
  MPU-6050
  Read accel, temp and gyro, error = 0
  accel x,y,z: 160, 100, 15716
  temperature: 31.000 degrees Celsius
  gyro x,y,z : -8, -241, -248,
  
  MPU-6050
  Read accel, temp and gyro, error = 0
  accel x,y,z: 192, 56, 15712
  temperature: 31.000 degrees Celsius
  gyro x,y,z : -36, -212, -222,
  
  MPU-6050
  Read accel, temp and gyro, error = 0
  accel x,y,z: 212, 100, 15440
  temperature: 30.906 degrees Celsius
  gyro x,y,z : -32, -253, -240,
  </code></pre>