struct rt_sensor_data
{
rt_uint32_t timestamp; / The timestamp when the data was received /
rt_uint8_t type; / The sensor type of the data /
union
{
struct sensor_3_axis acce; / Accelerometer. unit: mG /
struct sensor_3_axis gyro; / Gyroscope. unit: mdps /
struct sensor_3_axis mag; / Magnetometer. unit: mGauss /
rt_int32_t temp; / Temperature. unit: dCelsius /
rt_int32_t humi; / Relative humidity. unit: permillage /
rt_int32_t baro; / Pressure. unit: pascal (Pa) /
rt_int32_t light; / Light. unit: lux /
rt_int32_t proximity; / Distance. unit: centimeters /
rt_int32_t hr; / Heart rate. unit: bpm /
rt_int32_t tvoc; / TVOC. unit: permillage /
rt_int32_t noise; / Noise Loudness. unit: HZ /
rt_uint32_t step; / Step sensor. unit: 1 /
rt_int32_t force; / Force sensor. unit: mN /
} data;
};
以上这个数据类型只能放一个变量,但是市场上有一种传感器是可以放置两个的,名称叫DHT11也是单总线,但是可以一次传输两个数据,一个是温度,一个是湿度,所以相应的注册部分也是需要修改的,请官方熟知
更多回帖