next test with cooldown (1 sec)

master
Ebbe Baß 2022-07-10 18:58:12 +02:00
parent fdde4bccef
commit 85351558db
2 changed files with 2 additions and 4 deletions

View File

@ -75,6 +75,4 @@ def get_moisture():
sps = 250
adc = SDL_Adafruit_ADS1x15.ADS1x15(ic=ADS1115)
voltsChArray = [adc.readADCSingleEnded(0, gain, sps) / 1000, adc.readADCSingleEnded(1, gain, sps) / 1000, adc.readADCSingleEnded(2, gain, sps) / 1000, adc.readADCSingleEnded(3, gain, sps) / 1000]
return sum(voltsChArray) / float(len(voltsChArray))
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

@ -17,7 +17,7 @@ def get_moisture():
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
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())