Reading Data
After configuring the output of the sensor via I2C, you can unplug the sensor from the I2C port and connect it to analog or digital ports. How to configure and read from these analog and digital ports is detailed in this page.
Digital Reads
In the configuration screen, go to "Digital Devices," select "Digital Device," and name your digital pins. After activating the config, the following code can be used to read the digital values:
Analog Reads
In the configuration screen, go to "Analog Inputs," select "Analog Input," and name your analog pin. After activating the config, the following code can be used to read the analog value:
Scaling Analog Voltage
Analog voltages span from 0-3.3V, which can be converted into real distance units by scaling it:
The value 4000 assumes that our configuration code analog bounds went from 0-4000.
Bulk Reading
Last updated