Murthy Varanasi
Murthy Varanasi

Reputation: 136

Import adafruit_ads1x15_ads1115 as ADS giving syntax error

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

Answers (0)

Related Questions