title: how to access the magnetometer of mpu9250?
body: <p>i have accessed mpu-9250 using address 0x68 and reading the data of accelerometer and gyroscope.</p>
  
  <p>but now when i changed address to 0x0C to access magnetometer and whenever tried to read data,but it will not give acknowledgment.</p>
  
  <p>i have also enable_bypass_i2c_pin.</p>
  
  <p>i have used below code: i have issue to get data of magnetometer.</p>
  
  <pre><code>readBytes_jt(0x68, MPU9250_RA_ACCEL_XOUT_H, 14, buffer);
      *ax = (((int16_t)buffer[0]) &lt;&lt; 8) | buffer[1];
      *ay = (((int16_t)buffer[2]) &lt;&lt; 8) | buffer[3];
      *az = (((int16_t)buffer[4]) &lt;&lt; 8) | buffer[5];
      *gx = (((int16_t)buffer[8]) &lt;&lt; 8) | buffer[9];
      *gy = (((int16_t)buffer[10]) &lt;&lt; 8) | buffer[11];
      *gz = (((int16_t)buffer[12]) &lt;&lt; 8) | buffer[13];
  
  //read mag
      writeByte_jt(0x68, MPU9250_RA_INT_PIN_CFG, 0x02); //set i2c bypass enable pin to true to access magnetometer
  //  delay(10);
      delay_s_jt(10);
  
      writeByte_jt(0x0C, 0x0A, 0x01); //enable the magnetometer
  //  delay(10);
      delay_s_jt(10);
  
      readBytes_jt(0x0C,MPU9150_RA_MAG_XOUT_L, 6, buffer);
      *mx = (((int16_t)buffer[1]) &lt;&lt; 8) | buffer[0];
      *my = (((int16_t)buffer[3]) &lt;&lt; 8) | buffer[2];
      *mz = (((int16_t)buffer[5]) &lt;&lt; 8) | buffer[4];
  </code></pre>