Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

传感器

从传感器读取数据

连接到不同传感器读取数据。

函数

全部展开

mpu9250Connect to MPU-9250 sensor on Arduino hardware I2C bus
lsm9ds1Connect to LSM9DS1 sensor on Arduino hardware I2C bus
mpu6050Connect to MPU-6050 sensor on Arduino hardware I2C bus
lsm303cConnect to LSM303C sensor Arduino hardware I2C bus (自 R2021a 起)
lsm6ds3Connect to LSM6DS3 sensor on Arduino hardware I2C bus (自 R2021a 起)
lsm6ds3hConnect to LSM6DS3H sensor on Arduino hardware I2C bus (自 R2021a 起)
lsm6dslConnection to LSM6DSL sensor on Arduino hardware I2C bus (自 R2021a 起)
lsm6dsmConnect to LSM6DSM sensor on Arduino hardware I2C bus (自 R2021a 起)
lsm6dsoConnect to LSM6DSO sensor on Arduino hardware I2C bus (自 R2021a 起)
lsm6dsrConnect to LSM6DSR sensor on Arduino hardware I2C bus (自 R2021a 起)
hts221Connect to HTS221 sensor on Arduino hardware I2C bus (自 R2021a 起)
lps22hbConnect to LPS22HB sensor on Arduino hardware I2C bus (自 R2021a 起)
adxl345Connect to ADXL345, ADXL343, ADXL344, or ADXL346 sensor on Arduino hardware I2C bus (自 R2022a 起)
icm20948Connect to ICM-20948 sensor on Arduino hardware I2C bus (自 R2022a 起)
bmp280Connect to BMP280 sensor on Arduino hardware I2C bus (自 R2022b 起)
lis3dhConnect to LIS3DH sensor on Arduino hardware I2C bus (自 R2022b 起)
bmi160Connect to BMI160 sensor on Arduino hardware I2C bus (自 R2023a 起)
adis16505Connect to ADIS16505 sensor on Arduino hardware SPI bus (自 R2024a 起)
flushFlush the host buffer
infoRead information related to sensor
readRead real-time sensor data at a specified rate
readAccelerationRead one sample of acceleration from sensor
readAngularVelocityRead one sample of angular velocity from sensor
readMagneticFieldRead one sample of magnetic field from sensor
readTemperatureRead one sample of temperature from sensor (自 R2021a 起)
readHumidityRead one sample of relative humidity data from the sensor (自 R2021a 起)
readPressureRead one sample of barometric air pressure data from the sensor (自 R2021a 起)
readVoltageRead voltage from ADC pins on sensor (自 R2023a 起)
releaseRelease the sensor object
stopStop data collection from sensor object (自 R2020a 起)
bno055Connect to BNO055 sensor on Arduino hardware I2C bus (自 R2020a 起)
flushFlush the host buffer for BNO055 sensor
infoRead output data rate and bandwidth setting of BNO055 sensor
readRead acceleration, angular velocity, magnetic field, time, and overrun data from BNO055 sensor
readAccelerationRead one sample of acceleration from BNO055 sensor
readAngularVelocityRead one sample of angular velocity from BNO055 sensor
readCalibrationStatusRead calibration status of BNO055 sensor
readMagneticFieldRead one sample of magnetic field strength from BNO055 sensor
readOrientationRead orientation data from BNO055 sensor
releaseRelease the BNO055 object
gpsdevConnect to GPS receiver on Arduino hardware (自 R2020a 起)
flushFlush the host buffer (自 R2020a 起)
infoRead Update Rate, GPS Lock information and number of satellites in View for the GPS receiver (自 R2020a 起)
readRead data from GPS (自 R2020a 起)
releaseRelease the GPS object (自 R2020a 起)
stopStop data collection from GPS module (自 R2020a 起)
writeBytesWrite raw data to GPS module (自 R2020a 起)
apds9960Connect to APDS9960 sensor on Arduino hardware using I2C bus (自 R2021b 起)
readColorReads clear light and RGB components through APDS9960 sensor (自 R2021b 起)
readGestureRead gesture through APDS9960 sensor (自 R2021b 起)
readProximityRead the proximity from APDS9960 sensor (自 R2021b 起)
ultrasonicConnection to ultrasonic sensor on Arduino hardware
readDistanceDistance to object in front of ultrasonic sensor
readEchoTimeRead echo time of ultrasound waves

主题

疑难解答

Troubleshooting Sensors

Troubleshoot sensors.

精选示例