This commit is contained in:
2026-05-20 15:33:38 -04:00
commit dbd015f3b8
8 changed files with 121 additions and 0 deletions

18
test.py Normal file
View File

@@ -0,0 +1,18 @@
import time
import board
import busio
import adafruit_ads1x15.ads1115 as ADS
from adafruit_ads1x15.analog_in import AnalogIn
i2c = busio.I2C(board.SCL, board.SDA)
# Create the ADS object and specify the gain
ads = ADS.ADS1115(i2c)
ads.gain = 1
chan = AnalogIn(ads, ADS.P0)
# Continuously print the values
while True:
print(f"MQ-135 Voltage: {chan.voltage}V")
time.sleep(1)