da testare
Dependencies: mbed
Fork of programmaACC by
Diff: MPU6050.h
- Revision:
- 4:fa71806deb67
- Parent:
- 0:7d3cc2de8dd2
--- a/MPU6050.h Fri Mar 30 16:29:45 2018 +0000 +++ b/MPU6050.h Wed Apr 25 11:59:37 2018 +0000 @@ -151,7 +151,7 @@ // Specify sensor full scale int Gscale = GFS_250DPS; -int Ascale = AFS_2G; +int Ascale = AFS_4G; //Set up I2C, (SDA,SCL) I2C i2c(I2C_SDA, I2C_SCL); @@ -442,7 +442,7 @@ fifo_count = ((uint16_t)data[0] << 8) | data[1]; packet_count = fifo_count/12;// How many sets of full gyro and accelerometer data for averaging - for (ii = 0; ii < packet_count; ii++) { +/* for (ii = 0; ii < packet_count; ii++) { int16_t accel_temp[3] = {0, 0, 0}, gyro_temp[3] = {0, 0, 0}; readBytes(MPU6050_ADDRESS, FIFO_R_W, 12, &data[0]); // read data for averaging accel_temp[0] = (int16_t) (((int16_t)data[0] << 8) | data[1] ) ; // Form signed 16-bit integer for each sample in FIFO @@ -459,8 +459,8 @@ gyro_bias[1] += (int32_t) gyro_temp[1]; gyro_bias[2] += (int32_t) gyro_temp[2]; -} - accel_bias[0] /= (int32_t) packet_count; // Normalize sums to get average count biases +}*/ +/* accel_bias[0] /= (int32_t) packet_count; // Normalize sums to get average count biases accel_bias[1] /= (int32_t) packet_count; accel_bias[2] /= (int32_t) packet_count; gyro_bias[0] /= (int32_t) packet_count; @@ -537,7 +537,7 @@ // Output scaled accelerometer biases for manual subtraction in the main program dest2[0] = (float)accel_bias[0]/(float)accelsensitivity; dest2[1] = (float)accel_bias[1]/(float)accelsensitivity; - dest2[2] = (float)accel_bias[2]/(float)accelsensitivity; + dest2[2] = (float)accel_bias[2]/(float)accelsensitivity;*/ }