From ceb5b9728cd28dd3dee8765b8fdfc3b5147899b4 Mon Sep 17 00:00:00 2001 From: Mark Tyers Date: Tue, 13 Aug 2019 14:03:27 +0100 Subject: [PATCH] removed old file --- sample_code/ADS1115_ACD_to_I2C.py | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 sample_code/ADS1115_ACD_to_I2C.py diff --git a/sample_code/ADS1115_ACD_to_I2C.py b/sample_code/ADS1115_ACD_to_I2C.py deleted file mode 100644 index c535c02..0000000 --- a/sample_code/ADS1115_ACD_to_I2C.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 - -# This script reads an analog voltage on channel 0 on an ADS1115 and outputs -# an integer value that corresponds to this voltage. -# https://cdn-shop.adafruit.com/datasheets/ads1115.pdf - -# $ sudo apt-get install python3 python3-pip python-dev python-smbus -# $ sudo pip3 install smbus Adafruit-Blinka adafruit-circuitpython-ads1x15 - -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 I2C bus -ads = ADS.ADS1115(i2c) # Create the ADC object using the I2C bus -chan = AnalogIn(ads, ADS.P0) # Create single-ended input on channel 0 - -while True: - print("{:>5.3f}".format(chan.voltage)) - time.sleep(0.1)