We are about to run two programs:
- chapter09/ldr_ads1115_calibrate.py, which will help us calibrate our LDR readings
- chapter09/ldr_ads1115.py, which monitors the light level and switches on the LED when the light falls below a configurable level
First, we should check that the ADS1115 is connected correctly and can be seen by your Raspberry Pi. Run the i2cdetect command in a Terminal. If your output does not include a number (for example 48), then please verify your wiring:
$ i2cdetect -y 1
# ... truncated ...
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# ... truncated ...
We first covered the ADS1115 analog-to-digital converter and the i2cdetect utility in Chapter 5, Connecting Your Raspberry Pi to the Physical World.
Let's run the examples, starting with the calibration program:
- Run the code found in the chapter09/ldr_ads1115_calibrate...