Read the proximity from APDS9960 sensor
Read Proximity from Sensor
Create an Arduino object.
arduinoobj = arduino('COM4', 'Nano33BLE', 'Libraries', 'APDS9960');
Create the sensor object for the sensor in use.
apds9960obj = apds9960(arduinoobj)
Return one sample of the proximity data.
proximReadings = readProximity(apds9960obj)
proximReadings = 0.9647
APDS9960 sensor object
APDS9960 sensor connection, specified as a
proximity — Proximity value read from the sensor
scalar in the range of [0,1]
Proximity value read from the sensor, ranges from 0 and 1 with 0 being the most proximal.
timestamp — Timestamp of the sensor data
The time at which MATLAB® receives the proximity data from the sensor, specified as a datetime.