diff --git a/ohmpy_v_1_01.py b/ohmpy_v_1_01.py index d74c18fbe9da0e98040993b86989dc0d0314baad..feb91474639f1823c6ac2797cf4fc0cbd68f9180 100644 --- a/ohmpy_v_1_01.py +++ b/ohmpy_v_1_01.py @@ -3,14 +3,13 @@ OHMPY_code is a program to control the low-cost and open source resistivity meter OHMPY, it has been developed by Rémi CLEMENT,Vivien DUBOIS, Nicolas FORQUET (IRSTEA) and Yannick FARGIER (IFSTTAR). """ -print 'OHMPI start' -print MyDateTime.isoformat() -print 'Import library' +print('OHMPI start' ) +print()'Import library') #!/usr/bin/python import RPi.GPIO as GPIO import time -import datetime +from datetime import datetime import board import busio import numpy @@ -19,11 +18,20 @@ import sys import adafruit_ads1x15.ads1115 as ADS from adafruit_ads1x15.analog_in import AnalogIn +""" +display start time +""" +current_time = datetime.now() +print(current_time.strftime("%Y-%m-%d %H:%M:%S")) + """ parameters """ nb_electrodes = 32 # maximum number of electrodes on the resistivity meter - +injection_time = 5 # Current injection time in second +nbr_meas= 900 # Number of times the quadripole sequence is repeated +sequence_delay= 30 # Delay in seconds between 2 sequences +stack= 1 # repetition of the current injection for each quadripole """ functions @@ -66,14 +74,9 @@ def read_quad(filename, nb_elec): else: return output - GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) -#i2c = busio.I2C(board.SCL, board.SDA) -# Create the ADC object using the I2C bus -#ads = ADS.ADS1115(i2c) -#chan = AnalogIn(ads, ADS.P0) """ Initialization of multiplexer channels """ @@ -81,13 +84,6 @@ pinList = [12,16,20,21,26,18,23,24,25,19,6,13,4,17,27,22,10,9,11,5] # List of GP for i in pinList: GPIO.setup(i, GPIO.OUT) GPIO.output(i, GPIO.HIGH) -""" -Measurement settings -""" -injection_time = 5 # Current injection time in second -nbr_meas= 900 # Number of times the quadrupole sequence is repeated -sequence_delay= 30 # Delay in Second between 2 sequences -stack= 1 # repetition of the current injection for each quadrupole """ Reading the quadripole file @@ -103,7 +99,7 @@ for g in range(0,nbr_meas): # for time-lapse monitoring # call switch_mux function switch_mux(N[i,]) - time.sleep(injection_time); + time.sleep(injection_time) GPIO.output(12, GPIO.HIGH); GPIO.output(16, GPIO.HIGH); GPIO.output(20, GPIO.HIGH); GPIO.output(21, GPIO.HIGH); GPIO.output(26, GPIO.HIGH) GPIO.output(18, GPIO.HIGH); GPIO.output(23, GPIO.HIGH); GPIO.output(24, GPIO.HIGH); GPIO.output(25, GPIO.HIGH); GPIO.output(19, GPIO.HIGH) GPIO.output(6, GPIO.HIGH); GPIO.output(13, GPIO.HIGH); GPIO.output(4, GPIO.HIGH); GPIO.output(17, GPIO.HIGH); GPIO.output(27, GPIO.HIGH)