From 376f2582dacd3e7ccfb938db2356cbd0d028e71e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Wed, 13 Jul 2022 09:43:04 +0200 Subject: [PATCH] removed tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- test.py | 52 ---------------------------------------------------- 1 file changed, 52 deletions(-) diff --git a/test.py b/test.py index dcf57e5..e69de29 100644 --- a/test.py +++ b/test.py @@ -1,52 +0,0 @@ -import time, signal, sys -sys.path.append('./SDL_Adafruit_ADS1x15') - -import SDL_Adafruit_ADS1x15 - -def signal_handler(signal, frame): - print( 'You pressed Ctrl+C!') - sys.exit(0) -signal.signal(signal.SIGINT, signal_handler) - -ADS1115 = 0x01 # 16-bit ADC - -# Select the gain -# gain = 6144 # +/- 6.144V -gain = 4096 # +/- 4.096V -# gain = 2048 # +/- 2.048V -# gain = 1024 # +/- 1.024V -# gain = 512 # +/- 0.512V -# gain = 256 # +/- 0.256V - -# Select the sample rate -# sps = 8 # 8 samples per second -# sps = 16 # 16 samples per second -# sps = 32 # 32 samples per second -# sps = 64 # 64 samples per second -# sps = 128 # 128 samples per second -sps = 250 # 250 samples per second -# sps = 475 # 475 samples per second -# sps = 860 # 860 samples per second - -# Initialise the ADC using the default mode (use default I2C address) -adc = SDL_Adafruit_ADS1x15.ADS1x15(ic=ADS1115) -while (1): - - # Read channels in single-ended mode using the settings above - - print ("--------------------") - voltsCh0 = adc.readADCSingleEnded(0, gain, sps) / 1000 - rawCh0 = adc.readRaw(0, gain, sps) - print ("Channel 0 =%.6fV raw=0x%4X dec=%d" % (voltsCh0, rawCh0, rawCh0)) - voltsCh1 = adc.readADCSingleEnded(1, gain, sps) / 1000 - rawCh1 = adc.readRaw(1, gain, sps) - print ("Channel 1 =%.6fV raw=0x%4X dec=%d" % (voltsCh1, rawCh1, rawCh1)) - voltsCh2 = adc.readADCSingleEnded(2, gain, sps) / 1000 - rawCh2 = adc.readRaw(2, gain, sps) - print ("Channel 2 =%.6fV raw=0x%4X dec=%d" % (voltsCh2, rawCh2, rawCh2)) - voltsCh3 = adc.readADCSingleEnded(3, gain, sps) / 1000 - rawCh3 = adc.readRaw(3, gain, sps) - print ("Channel 3 =%.6fV raw=0x%4X dec=%d" % (voltsCh3, rawCh3, rawCh3)) - print ("--------------------") - - time.sleep(0.5) \ No newline at end of file