From 4ecc54fbc9b68b477d0d46b24d1bccd809b00ae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Sun, 10 Jul 2022 00:26:32 +0200 Subject: [PATCH] next test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test.py b/test.py index 86f1a9e..be339ef 100644 --- a/test.py +++ b/test.py @@ -17,9 +17,9 @@ 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] + voltsCh = 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 voltsCh while True: print(get_moisture()) \ No newline at end of file