【Renesas RA6M4开发板之I2C读取mpu6050】

1.0 mpu6050
此图转载钦源盛数码专营店
本篇通过renesas ra6m4开发板采用i2c读取mpu6050传感器的角加速度,角速度和温度示例程序演示。
1.1 mpu6050介绍mpu6050是一种非常流行的空间运动传感器芯片,可以获取器件当前的三个加速度分量和三个旋转角速度。由于其体积小巧,功能强大,精度较高,不仅被广泛应用于工业,同时也是航模爱好者的神器,被安装在各类飞行器上驰骋蓝天。
1.2 mpu6050特点使用芯片:mpu-6050
供电电源:3-5v(内部低压差稳压)
通信方式:标准lic通信协议
芯片内置16bitad转换器,16位数据输出
陀螺仪范围:±250 500 1000 2000 °/s
加速度范围:±2±4±8±16g
温度范围:-20℃~60℃
采用沉金pcb,机器焊接工艺保证质量
引脚间距2.54mm
需在气体环境中工作,不可测量液体和反接电源
尺寸大小如下:
1.3 mpu6050应用运动感测游戏
现实增强
行人导航器
“零触控”手势用户接口
姿势快捷方式
认证
电子稳像(eis: electronic lmage stabilization )
光学稳像(ols: optical lmage stabilization )
rt-theard配置 2.1 硬件需求1、需要mpu6050采集气体环境下的气压和温度,i2c通讯接线 sda—p504;scl—p506 ,不需要关注地址后面库自带配置了,与ssd1306不同实现功能:
采用i2c读取mpu6050传感器的角加速度,角速度和温度示例
2、ra6m4开发板
3、usb下载线,ch340串口和附带6根母母线, rx—p613;tx—p614
2.2 软件配置renesas ra6m4开发板环境配置参照:【基于 rt-thread studio的cpk-ra6m4 开发板环境搭建】
1、新建项目ra6m4-mpu6050工程
2、点击rt-theard setting,在软件包下添加软件包,然后搜索mpu相关软件支持包,点击添加即可,然后出现对应包。
3、配置ssd306,右键选择配置项
4、在软件包中开启示例程序。
5、在硬件中,启动i2c,设置端口sda—p505;scl—p506
6、全部保存刚刚的配置,更新当前配置文件
保存完是灰色,没有保存是蓝色。
代码分析1、刚刚加载软件包在packages文件夹下,
mpu6xxx.c代码更改为如下
(或者头文件添加#include bsp_api.h,否则会报错unitx_t,根据提示全部改为rt_unitx_t也ok,下面是第二种方法,增加了手动校准)
mpu6xxx.c
/* * copyright (c) 2006-2022, rt-thread development team * * spdx-license-identifier: apache-2.0 * * change logs: * date author notes * 2018-10-23 flybreak the first version * 2021-09-09 scratch-er added setting and getting sensor offsets */#include #include #include #include #define dbg_tag mpu6xxx#define dbg_lvl dbg_info#include #include mpu6xxx.h#include mpu6xxx_reg.h#ifdef pkg_using_mpu6xxx_mag#include ak8963_reg.h#endif#define mpu6xxx_accel_sen (16384)#define mpu6xxx_gyro_sen (1310)#define mpu60x0_spi_max_speed (1000 * 1000)#define mpu60x0_temp_sen (340)#define mpu60x0_temp_offset (36.5)#define mpu6500_temp_sen (333.87)#define mpu6500_temp_offset (21)// mag#define ak8963_range (4912)#define ak8963_fullscale (32760)/** * this function writes the value of the register for mpu6xxx * * @param dev the pointer of device driver structure * @param reg the register for mpu6xxx * @param data value to write * * @return the writing status, rt_eok reprensents writing the value of the register successfully. */static rt_err_t mpu6xxx_write_reg(struct mpu6xxx_device *dev, rt_uint8_t reg, rt_uint8_t data){ rt_int8_t res = 0;#ifdef rt_using_i2c struct rt_i2c_msg msgs; rt_uint8_t buf[2] = { reg, data};#endif if (dev->bus->type == rt_device_class_i2cbus) { #ifdef rt_using_i2c msgs.addr = dev->i2c_addr; /* slave address */ msgs.flags = rt_i2c_wr; /* write flag */ msgs.buf = buf; /* send data pointer */ msgs.len = 2; if (rt_i2c_transfer((struct rt_i2c_bus_device *)dev->bus, &msgs, 1) == 1) { res = rt_eok; } else { res = -rt_error; }#endif } else { #ifdef rt_using_spi res = rt_spi_send_then_send((struct rt_spi_device *)dev->bus, ®, 1, &data, 1);#endif } return res;}/** * this function reads the value of registers for mpu6xxx * * @param dev the pointer of device driver structure * @param reg the register for mpu6xxx * @param len number of register * @param buf read data pointer * * @return the reading status, rt_eok reprensents reading the value of registers successfully. */static rt_err_t mpu6xxx_read_regs(struct mpu6xxx_device *dev, rt_uint8_t reg, rt_uint8_t len, rt_uint8_t *buf){ rt_int8_t res = 0;#ifdef rt_using_i2c struct rt_i2c_msg msgs[2];#endif#ifdef rt_using_spi rt_uint8_t tmp;#endif if (dev->bus->type == rt_device_class_i2cbus) { #ifdef rt_using_i2c msgs[0].addr = dev->i2c_addr; /* slave address */ msgs[0].flags = rt_i2c_wr; /* write flag */ msgs[0].buf = ® /* slave register address */ msgs[0].len = 1; /* number of bytes sent */ msgs[1].addr = dev->i2c_addr; /* slave address */ msgs[1].flags = rt_i2c_rd; /* read flag */ msgs[1].buf = buf; /* read data pointer */ msgs[1].len = len; /* number of bytes read */ if (rt_i2c_transfer((struct rt_i2c_bus_device *)dev->bus, msgs, 2) == 2) { res = rt_eok; } else { res = -rt_error; }#endif } else { #ifdef rt_using_spi //the first bit of the first byte contains the read/write bit and indicates the read (1) or write (0) operation. tmp = reg | 0x80; res = rt_spi_send_then_recv((struct rt_spi_device *)dev->bus, &tmp, 1, buf, len);#endif } return res;}/** * this function writes a bit value of registers for mpu6xxx * * @param dev the pointer of device driver structure * @param reg the register for mpu6xxx * @param bit the position of the register * @param data value to write * * @return the writing status, rt_eok reprensents writing a bit value of registers successfully. */static rt_err_t mpu6xxx_write_bit(struct mpu6xxx_device *dev, rt_uint8_t reg, rt_uint8_t bit, rt_uint8_t data){ rt_uint8_t byte; rt_err_t res; res = mpu6xxx_read_regs(dev, reg, 1, &byte); if (res != rt_eok) { return res; } byte = (data != 0) ? (byte | (1 << bit)) : (byte & ~(1 << bit)); return mpu6xxx_write_reg(dev, reg, byte);}/** * this function reads a bit value of registers for mpu6xxx * * @param dev the pointer of device driver structure * @param reg the register for mpu6xxx * @param bit the position of the register * @param data read data pointer * * @return the reading status, rt_eok reprensents reading a bit value of registers successfully. */static rt_err_t mpu6xxx_read_bit(struct mpu6xxx_device *dev, rt_uint8_t reg, rt_uint8_t bit, rt_uint8_t *data){ rt_uint8_t byte; rt_err_t res; res = mpu6xxx_read_regs(dev, reg, 1, &byte); if (res != rt_eok) { return res; } *data = byte & (1 << bit); return rt_eok;}/** * this function writes multi-bit value of registers for mpu6xxx * * @param dev the pointer of device driver structure * @param reg the register for mpu6xxx * @param start_bit the start position of the register * @param len number of bits to write * @param data value to write * * @return the writing status, rt_eok reprensents writing multi-bit value of registers successfully. */static rt_err_t mpu6xxx_write_bits(struct mpu6xxx_device *dev, rt_uint8_t reg, rt_uint8_t start_bit, rt_uint8_t len, rt_uint8_t data){ rt_uint8_t byte, mask; rt_err_t res; res = mpu6xxx_read_regs(dev, reg, 1, &byte); if (res != rt_eok) { return res; } mask = ((1 << len) - 1) << (start_bit - len + 1); data <<= (start_bit - len + 1); // shift data into correct position data &= mask; // zero all non-important bits in data byte &= ~(mask); // zero all important bits in existing byte byte |= data; // combine data with existing byte return mpu6xxx_write_reg(dev, reg, byte);}/** * this function reads multi-bit value of registers for mpu6xxx * * @param dev the pointer of device driver structure * @param reg the register for mpu6xxx * @param start_bit the start position of the register * @param len number of bits to write * @param data read data pointer * * @return the reading status, rt_eok reprensents reading multi-bit value of registers successfully. */static rt_err_t mpu6xxx_read_bits(struct mpu6xxx_device *dev, rt_uint8_t reg, rt_uint8_t start_bit, rt_uint8_t len, rt_uint8_t *data){ rt_uint8_t byte, mask; rt_err_t res; res = mpu6xxx_read_regs(dev, reg, 1, &byte); if (res != rt_eok) { return res; } mask = ((1 << len) - 1) <>= (start_bit - len + 1); *data = byte; return rt_eok;}// mag#ifdef pkg_using_mpu6xxx_mag#define mag_read_delay_time 50static void mpu92_mag_write_reg(struct mpu6xxx_device *dev, rt_uint8_t addr, rt_uint8_t data){ rt_uint8_t status = 0; rt_uint32_t timeout = mag_read_delay_time; mpu6xxx_write_reg(dev, mpu6xxx_ra_i2c_slv4_addr, ak8963_i2c_addr); mpu6xxx_write_reg(dev, mpu6xxx_ra_i2c_slv4_reg, addr); mpu6xxx_write_reg(dev, mpu6xxx_ra_i2c_slv4_do, data); mpu6xxx_write_reg(dev, mpu6xxx_ra_i2c_slv4_ctrl, mpu6500_i2c_slvx_en); do { mpu6xxx_read_regs(dev, mpu6xxx_ra_i2c_mst_status, 1, &status); rt_thread_mdelay(1); } while (((status & mpu6500_i2c_slv4_done) == 0) && (timeout--));}#endif // pkg_using_mpu6xxx_mag/** * this function gets the raw data of the accelerometer * * @param dev the pointer of device driver structure * @param accel the pointer of 3axes structure for receive data * * @return the reading status, rt_eok reprensents reading the data successfully. */static rt_err_t mpu6xxx_get_accel_raw(struct mpu6xxx_device *dev, struct mpu6xxx_3axes *accel){ rt_uint8_t buffer[6]; rt_err_t res; res = mpu6xxx_read_regs(dev, mpu6xxx_ra_accel_xout_h, 6, buffer); if (res != rt_eok) { return res; } accel->x = ((rt_uint16_t)buffer[0] config.accel_range = param; break; case mpu6xxx_dlpf_config: /* digital low pass filter */ res = mpu6xxx_write_bits(dev, mpu6xxx_ra_config, mpu6xxx_cfg_dlpf_cfg_bit, mpu6xxx_cfg_dlpf_cfg_length, param); break; case mpu6xxx_sample_rate: /* sample rate = 16-bit unsigned value. sample rate = [1000 - 4]hz when dlpf is enable sample rate = [8000 - 32]hz when dlpf is disable */ //sample rate = gyroscope output rate / (1 + smplrt_div) res = mpu6xxx_read_bits(dev, mpu6xxx_ra_config, mpu6xxx_cfg_dlpf_cfg_bit, mpu6xxx_cfg_dlpf_cfg_length, &data); if (res != rt_eok) { break; } if (data == 0 || data == 7) /* dlpf is disable */ { if (param > 8000) data = 0; else if (param 1000) data = 0; else if (param > dev->config.accel_range; accel->x = (rt_int32_t)tmp.x * 1000 / sen; accel->y = (rt_int32_t)tmp.y * 1000 / sen; accel->z = (rt_int32_t)tmp.z * 1000 / sen; return rt_eok;}/** * this function gets the data of the gyroscope, unit: deg/10s * here deg/10s means 10 times higher precision than deg/s. * * @param dev the pointer of device driver structure * @param gyro the pointer of 3axes structure for receive data * * @return the reading status, rt_eok reprensents reading the data successfully. */rt_err_t mpu6xxx_get_gyro(struct mpu6xxx_device *dev, struct mpu6xxx_3axes *gyro){ struct mpu6xxx_3axes tmp; rt_uint16_t sen; rt_err_t res; res = mpu6xxx_get_gyro_raw(dev, &tmp); if (res != rt_eok) { return res; } sen = mpu6xxx_gyro_sen >> dev->config.gyro_range; gyro->x = (rt_int32_t)tmp.x * 100 / sen; gyro->y = (rt_int32_t)tmp.y * 100 / sen; gyro->z = (rt_int32_t)tmp.z * 100 / sen; return rt_eok;}#ifdef pkg_using_mpu6xxx_mag/** * this function gets the data of the magnetometer, unit: ut * * @param dev the pointer of device driver structure * @param gyro the pointer of 3axes structure for receive data * * @return the reading status, rt_eok reprensents reading the data successfully. */rt_err_t mpu6xxx_get_mag(struct mpu6xxx_device *dev, struct mpu6xxx_3axes *mag){ struct mpu6xxx_3axes tmp; rt_err_t res; res = mpu6xxx_get_mag_raw(dev, &tmp); if (res != rt_eok) { return res; } mag->x = ((rt_int32_t)tmp.x * ak8963_range) / ak8963_fullscale; mag->y = ((rt_int32_t)tmp.y * ak8963_range) / ak8963_fullscale; mag->z = ((rt_int32_t)tmp.z * ak8963_range) / ak8963_fullscale; return rt_eok;}#endif/** * this function gets the data of the temperature, unit: centigrade * * @param dev the pointer of device driver structure * @param temp read data pointer * * @return the reading status, rt_eok reprensents reading the data successfully. */rt_err_t mpu6xxx_get_temp(struct mpu6xxx_device *dev, float *temp){ rt_int16_t tmp; rt_err_t res; res = mpu6xxx_get_temp_raw(dev, &tmp); if (res != rt_eok) { return res; } if (dev->id == mpu6050_who_am_i) { /* mpu60x0: temperature in degrees c = (temp_out register value as a signed quantity)/340 + 36.53 */ *temp = (double)tmp / mpu60x0_temp_sen + mpu60x0_temp_offset; } else { /* mpu6500: ((temp_out - roomtemp_offset)/temp_sensitivity)+ 21degc */ *temp = (double)tmp / mpu6500_temp_sen + mpu6500_temp_offset; } return rt_eok;}/** * this function sets the offset of the accelerometer * * @param dev the pointer of device driver structure * @param offset the pointer of 3axes structure of offsets * * @return the setting status, rt_eok reprensents setting the offsets successfully. */rt_err_t mpu6xxx_set_accel_offset(struct mpu6xxx_device *dev, struct mpu6xxx_3axes *offset){ rt_err_t res=0; res |= mpu6xxx_write_reg(dev, mpu6xxx_ra_xa_offs_h, (offset->x)>>8); res |= mpu6xxx_write_reg(dev, mpu6xxx_ra_xa_offs_l_tc, (offset->x)&0x00ff); res |= mpu6xxx_write_reg(dev, mpu6xxx_ra_ya_offs_h, (offset->y)>>8); res |= mpu6xxx_write_reg(dev, mpu6xxx_ra_ya_offs_l_tc, (offset->y)&0x00ff); res |= mpu6xxx_write_reg(dev, mpu6xxx_ra_za_offs_h, (offset->z)>>8); res |= mpu6xxx_write_reg(dev, mpu6xxx_ra_za_offs_l_tc, (offset->z)&0x00ff); return res;}/** * this function gets the offset of the accelerometer * * @param dev the pointer of device driver structure * @param offset the pointer of 3axes structure of offsets * * @return the setting status, rt_eok reprensents reading the offsets successfully. */rt_err_t mpu6xxx_get_accel_offset(struct mpu6xxx_device *dev, struct mpu6xxx_3axes *offset){ rt_uint8_t buffer[6]; rt_err_t res; res = mpu6xxx_read_regs(dev, mpu6xxx_ra_xa_offs_h, 6, buffer); if (res != rt_eok) { return res; } offset->x = ((rt_uint16_t)buffer[0] >8); res |= mpu6xxx_write_reg(dev, mpu6xxx_ra_xg_offs_usrl, (offset->x)&0x00ff); res |= mpu6xxx_write_reg(dev, mpu6xxx_ra_yg_offs_usrh, (offset->y)>>8); res |= mpu6xxx_write_reg(dev, mpu6xxx_ra_yg_offs_usrl, (offset->y)&0x00ff); res |= mpu6xxx_write_reg(dev, mpu6xxx_ra_zg_offs_usrh, (offset->z)>>8); res |= mpu6xxx_write_reg(dev, mpu6xxx_ra_zg_offs_usrl, (offset->z)&0x00ff); return res;}/** * this function gets the offset of the gyroscope * * @param dev the pointer of device driver structure * @param offset the pointer of 3axes structure of offsets * * @return the setting status, rt_eok reprensents reading the offsets successfully. */rt_err_t mpu6xxx_get_gyro_offset(struct mpu6xxx_device *dev, struct mpu6xxx_3axes *offset){ rt_uint8_t buffer[6]; rt_err_t res; res = mpu6xxx_read_regs(dev, mpu6xxx_ra_xg_offs_usrh, 6, buffer); if (res != rt_eok) { return res; } offset->x = ((rt_uint16_t)buffer[0] bus == rt_null) { log_e(can't find device:'%s', dev_name); goto __exit; } if (dev->bus->type == rt_device_class_i2cbus) { if (param != rt_null) { dev->i2c_addr = param; } else { /* find mpu6xxx device at address: 0x68 */ dev->i2c_addr = mpu6xxx_address_ad0_low; if (mpu6xxx_read_regs(dev, mpu6xxx_ra_who_am_i, 1, ®) != rt_eok) { /* find mpu6xxx device at address 0x69 */ dev->i2c_addr = mpu6xxx_address_ad0_high; if (mpu6xxx_read_regs(dev, mpu6xxx_ra_who_am_i, 1, ®) != rt_eok) { log_e(can't find device at '%s'!, dev_name); goto __exit; } } log_d(device i2c address is:'0x%x'!, dev->i2c_addr); } } else if (dev->bus->type == rt_device_class_spidevice) { #ifdef rt_using_spi struct rt_spi_configuration cfg; cfg.data_width = 8; cfg.mode = rt_spi_master | rt_spi_mode_0 | rt_spi_msb; cfg.max_hz = mpu60x0_spi_max_speed; /* set spi max speed */ rt_spi_configure((struct rt_spi_device *)dev->bus, &cfg);#endif } else { log_e(unsupported device:'%s'!, dev_name); goto __exit; } if (mpu6xxx_read_regs(dev, mpu6xxx_ra_who_am_i, 1, ®) != rt_eok) { log_e(failed to read device id!); goto __exit; } dev->id = reg; switch (dev->id) { case mpu6050_who_am_i: log_i(find device: mpu6050!); break; case mpu6500_who_am_i: log_i(find device: mpu6500!); break; case mpu9250_who_am_i: log_i(find device: mpu9250!); break; case icm20608g_who_am_i: case icm20608d_who_am_i: log_i(find device: icm20608!); break; case 0xff: log_e(no device connection!); goto __exit; default: log_w(unknown device id: 0x%x!, reg); } res += mpu6xxx_get_param(dev, mpu6xxx_accel_range, &dev->config.accel_range); res += mpu6xxx_get_param(dev, mpu6xxx_gyro_range, &dev->config.gyro_range); res += mpu6xxx_write_bits(dev, mpu6xxx_ra_pwr_mgmt_1, mpu6xxx_pwr1_clksel_bit, mpu6xxx_pwr1_clksel_length, mpu6xxx_clock_pll_xgyro); res += mpu6xxx_set_param(dev, mpu6xxx_gyro_range, mpu6xxx_gyro_range_250dps); res += mpu6xxx_set_param(dev, mpu6xxx_accel_range, mpu6xxx_accel_range_2g); res += mpu6xxx_set_param(dev, mpu6xxx_sleep, mpu6xxx_sleep_disable);#ifdef pkg_using_mpu6xxx_mag mpu6xxx_write_reg(dev, mpu6xxx_ra_user_ctrl, 0x20); mpu92_mag_write_reg(dev, ak8963_reg_cntl2, 0x01); /* [0] reset device */ rt_thread_mdelay(1); mpu92_mag_write_reg(dev, ak8963_reg_cntl1, 0x00); /* [1] power-down mode */ mpu92_mag_write_reg(dev, ak8963_reg_cntl1, 0x0f); /* [2] fuse rom access mode */ mpu92_mag_write_reg(dev, ak8963_reg_cntl1, 0x00); /* [3] power-down mode */ rt_thread_mdelay(1); // 100us mpu92_mag_write_reg(dev, ak8963_reg_cntl1, 0x16); /* [4] 16bits and continuous measurement mode 2 */ /* config mpu9250 i2c */ rt_thread_mdelay(2); mpu6xxx_write_reg(dev, mpu6xxx_ra_i2c_mst_ctrl, 0x5d); rt_thread_mdelay(2); mpu6xxx_write_reg(dev, mpu6xxx_ra_i2c_slv0_addr, ak8963_i2c_addr | 0x80); rt_thread_mdelay(2); mpu6xxx_write_reg(dev, mpu6xxx_ra_i2c_slv0_reg, ak8963_reg_st1); rt_thread_mdelay(2); mpu6xxx_write_reg(dev, mpu6xxx_ra_i2c_slv0_ctrl, mpu6500_i2c_slvx_en | 8); rt_thread_mdelay(2); mpu6xxx_write_reg(dev, mpu6xxx_ra_i2c_slv4_ctrl, 0x09); rt_thread_mdelay(2); mpu6xxx_write_reg(dev, mpu6xxx_ra_i2c_mst_delay_ctrl, 0x81);#endif if (res == rt_eok) { log_i(device init succeed!); } else { log_w(error in device initialization!); } return dev;__exit: if (dev != rt_null) { rt_free(dev); } return rt_null;}/** * this function releases memory * * @param dev the pointer of device driver structure */void mpu6xxx_deinit(struct mpu6xxx_device *dev){ rt_assert(dev); rt_free(dev);}static void mpu6xxx(int argc, char **argv){ static struct mpu6xxx_device *dev = rt_null; /* if the number of arguments less than 2 */ if (argc mpu6xxxmpu6xxx [option] [param] probe probe mpu6xxx by given name such as i2c1 sr set sample rate to var var = [1000 - 4] when dlpf is enable var = [8000 - 32] when dlpf is disable gr set gyro range to var var = [0 - 3] means [250 - 2000dps] ar set accel range to var var = [0 - 3] means [2 - 16g] sleep set sleep status var = 0 means disable, = 1 means enable read [num] read [num] times mpu6xxx num default 5msh >mpu6xxx probe i2c1[i/mpu6xxx] find device: mpu6050![i/mpu6xxx] device init succeed!msh >mpu6xxx read 20accel.x = 200 mg, accel.y = -4 mg, accel.z = 3 mg, gyro.x = 0 deg/10s, gyro.y = -1 deg/10s, gyro.z = -2 deg/10s, mag.x = 0 ut, mag.y = 0 ut, mag.z = 0 uttemp = 31.65 ℃℃accel.x = 203 mg, accel.y = -4 mg, accel.z = 19 mg, gyro.x = -1 deg/10s, gyro.y = -1 deg/10s, gyro.z = 0 deg/10s, mag.x = 0 ut, mag.y = 0 ut, mag.z = 0 uttemp = 31.65 ℃℃accel.x = 194 mg, accel.y = -9 mg, accel.z = 6 mg, gyro.x = -1 deg/10s, gyro.y = 1 deg/10s, gyro.z = -2 deg/10s, mag.x = 0 ut, mag.y = 0 ut, mag.z = 0 uttemp = 31.60 ℃℃accel.x = 210 mg, accel.y = 11 mg, accel.z = 15 mg, gyro.x = -6 deg/10s, gyro.y = 0 deg/10s, gyro.z = -1 deg/10s, mag.x = 0 ut, mag.y = 0 ut, mag.z = 0 uttemp = 31.60 ℃℃accel.x = 389 mg, accel.y = 408 mg, accel.z = 499 mg, gyro.x = 25 deg/10s, gyro.y = -127 deg/10s, gyro.z = 353 deg/10s, mag.x = 0 ut, mag.y = 0 ut, mag.z = 0 uttemp = 31.65 ℃℃accel.x = 187 mg, accel.y = -218 mg, accel.z = -70 mg, gyro.x = 37 deg/10s, gyro.y = -15 deg/10s, gyro.z = 478 deg/10s, mag.x = 0 ut, mag.y = 0 ut, mag.z = 0 uttemp = 31.74 ℃℃accel.x = -149 mg, accel.y = -561 mg, accel.z = 246 mg, gyro.x = -2571 deg/10s, gyro.y = 479 deg/10s, gyro.z = 121 deg/10s, mag.x = 0 ut, mag.y = 0 ut, mag.z = 0 uttemp = 31.60 ℃℃accel.x = 104 mg, accel.y = -109 mg, accel.z = -42 mg, gyro.x = -1431 deg/10s, gyro.y = -1333 deg/10s, gyro.z = -1885 deg/10s, mag.x = 0 ut, mag.y = 0 ut, mag.z = 0 uttemp = 31.70 ℃℃accel.x = 677 mg, accel.y = -592 mg, accel.z = 330 mg, gyro.x = -313 deg/10s, gyro.y = -2479 deg/10s, gyro.z = -1443 deg/10s, mag.x = 0 ut, mag.y= 0 ut, mag.z = 0 uttemp = 31.55 ℃℃accel.x = 749 mg, accel.y = -57 mg, accel.z = -410 mg, gyro.x = -1377 deg/10s, gyro.y = -2479 deg/10s, gyro.z = -611 deg/10s, mag.x = 0 ut, mag.y= 0 ut, mag.z = 0 uttemp = 31.65 ℃℃accel.x = 512 mg, accel.y = -146 mg, accel.z = -1845 mg, gyro.x = -799 deg/10s, gyro.y = -2479 deg/10s, gyro.z = -149 deg/10s, mag.x = 0 ut, mag.y= 0 ut, mag.z = 0 uttemp = 31.55 ℃℃accel.x = -180 mg, accel.y = 420 mg, accel.z = -2800 mg, gyro.x = 519 deg/10s, gyro.y = 1497 deg/10s, gyro.z = 140 deg/10s, mag.x = 0 ut, mag.y = 0 ut, mag.z = 0 uttemp = 31.60 ℃℃accel.x = 237 mg, accel.y = 243 mg, accel.z = -1148 mg, gyro.x = 1585 deg/10s, gyro.y = 2523 deg/10s, gyro.z = 1265 deg/10s, mag.x = 0 ut, mag.y = 0 ut, mag.z = 0 uttemp = 31.60 ℃℃accel.x = 77 mg, accel.y = -667 mg, accel.z = -257 mg, gyro.x = 907 deg/10s, gyro.y = 2523 deg/10s, gyro.z = 1608 deg/10s, mag.x = 0 ut, mag.y = 0 ut, mag.z = 0 uttemp = 31.51 ℃℃accel.x = -239 mg, accel.y = -726 mg, accel.z = 644 mg, gyro.x = 557 deg/10s, gyro.y = 2523 deg/10s, gyro.z = 651 deg/10s, mag.x = 0 ut, mag.y = 0 ut, mag.z = 0 uttemp = 31.51 ℃℃accel.x = -230 mg, accel.y = -556 mg, accel.z = 181 mg, gyro.x = 215 deg/10s, gyro.y = 294 deg/10s, gyro.z = -54 deg/10s, mag.x = 0 ut, mag.y = 0 ut, mag.z = 0 uttemp = 31.65 ℃℃accel.x = -385 mg, accel.y = -600 mg, accel.z = 570 mg, gyro.x = -1 deg/10s, gyro.y = -2045 deg/10s, gyro.z = -128 deg/10s, mag.x = 0 ut, mag.y = 0 ut, mag.z = 0 uttemp = 31.55 ℃℃accel.x = -335 mg, accel.y = -419 mg, accel.z = -310 mg, gyro.x = -1128 deg/10s, gyro.y = -2479 deg/10s, gyro.z = -1016 deg/10s, mag.x = 0 ut, mag.y = 0 ut, mag.z = 0 uttemp = 31.55 ℃℃accel.x = 534 mg, accel.y = 100 mg, accel.z = -1428 mg, gyro.x = -1368 deg/10s, gyro.y = -2479 deg/10s, gyro.z = -1052 deg/10s, mag.x = 0 ut, mag.y = 0 ut, mag.z = 0 uttemp = 31.55 ℃℃accel.x = 469 mg, accel.y = 265 mg, accel.z = -1841 mg, gyro.x = -1220 deg/10s, gyro.y = -2479 deg/10s, gyro.z = -656 deg/10s, mag.x = 0 ut, mag.y = 0 ut, mag.z = 0 uttemp = 31.46 ℃℃数据显示一开始没有怎么变化,后面就会变化加快(我手抖了),mpu6050不支持磁力所以全部为零。
这样我们就可以天马行空啦!


士兰微厦门12英寸芯片生产线开工
夏普在中国广州召开主题为“智慧生态 引领未来”的新品发布会
国外程序员真的有想象中的那么好吗
中美为何如此重视量子科技?
信通院秦岩:小基站蓄势待发,将成5G网络重要组成
【Renesas RA6M4开发板之I2C读取mpu6050】
有人开源PyTorch实现极慢视频 突破人类极限
芬兰技术研究中心(VTT)推出的无人驾驶汽车 可在恶劣的天气情况下进行无间断的导航服务
网桥、Hub、交换机、路由器及其它
上海市和阿里、蚂蚁金服达成战略合作,马云透露更多业务将放在沪
移动电话技术:IBM与移动互联网
基于FPGA与PLL频率合成技术设计的整数/半整数频率合成器
2019年第二季度NAND和DRAM的跌幅可以达到15%至50%
光机械交换,光机械交换是什么意思
TrueEx计划推出一个用于加密货币资产的衍生品市场
低功耗蓝牙音频芯片BK3296,TWS/挂脖
固态存储回升 美光重金收购Virtensys
解锁每一款属于你的AI​,即刻预约Microsoft Ignite!
谷景测色环电感的测试频率为1K/0.3V
在MWC上的那些关于虚拟现实与5G合作的大动作