Reputation: 136
I am trying to interface vibration sensor with raspberrypi and when I am trying to read the values code is giving the following error
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)
ads = ADS.ADS1115(i2c)
ads.gain = 1
chan = AnalogIn(ads, ADS.P0)
while True:
print(f"MQ-135 Voltage:
{chan.voltage}V"}
time.sleep(1)
Upvotes: 0
Views: 44