added adafruit temp module into req list

Signed-off-by: Ebbe Baß <ebbe@ping-mee.de>
master
Ebbe Baß 2022-07-10 19:44:39 +02:00
parent 85351558db
commit 624274051e
3 changed files with 8 additions and 19 deletions

View File

@ -76,3 +76,4 @@ def get_moisture():
adc = SDL_Adafruit_ADS1x15.ADS1x15(ic=ADS1115)
return adc.readADCSingleEnded(0, gain, sps) / 1000 + adc.readADCSingleEnded(1, gain, sps) / 1000 + adc.readADCSingleEnded(2, gain, sps) / 1000 + adc.readADCSingleEnded(3, gain, sps) / 1000

View File

@ -1 +1,2 @@
gpiozero==1.6.2
adafruit-circuitpython-bmp280==3.2.15

23
test.py
View File

@ -1,24 +1,11 @@
import board
import busio
import adafruit_bmp280
import time
import signal
import sys
sys.path.append('./SDL_Adafruit_ADS1x15')
def get_temperature():
import SDL_Adafruit_ADS1x15
def signal_handler(signal, frame):
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
def get_moisture():
ADS1115 = 0x01
gain = 6144
sps = 250
adc = SDL_Adafruit_ADS1x15.ADS1x15(ic=ADS1115)
return adc.readADCSingleEnded(0, gain, sps) / 1000 + adc.readADCSingleEnded(1, gain, sps) / 1000 + adc.readADCSingleEnded(2, gain, sps) / 1000 + adc.readADCSingleEnded(3, gain, sps) / 1000
while True:
print(get_moisture())
print(get_temperature())
time.sleep(1)