added adafruit temp module into req list
Signed-off-by: Ebbe Baß <ebbe@ping-mee.de>master
parent
85351558db
commit
624274051e
1
main.py
1
main.py
|
@ -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
|
||||
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
gpiozero==1.6.2
|
||||
adafruit-circuitpython-bmp280==3.2.15
|
23
test.py
23
test.py
|
@ -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)
|
Loading…
Reference in New Issue