Commit 6392ba7f authored by Forquet Nicolas's avatar Forquet Nicolas
Browse files

bugs fixed on prints at the beginning of the file and all parameter values are...

bugs fixed on prints at the beginning of the file and all parameter values are gathered in one place
Showing with 14 additions and 18 deletions
+14 -18
...@@ -3,14 +3,13 @@ ...@@ -3,14 +3,13 @@
OHMPY_code is a program to control the low-cost and open source resistivity meter 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). OHMPY, it has been developed by Rémi CLEMENT,Vivien DUBOIS, Nicolas FORQUET (IRSTEA) and Yannick FARGIER (IFSTTAR).
""" """
print 'OHMPI start' print('OHMPI start' )
print MyDateTime.isoformat() print()'Import library')
print 'Import library'
#!/usr/bin/python #!/usr/bin/python
import RPi.GPIO as GPIO import RPi.GPIO as GPIO
import time import time
import datetime from datetime import datetime
import board import board
import busio import busio
import numpy import numpy
...@@ -19,11 +18,20 @@ import sys ...@@ -19,11 +18,20 @@ import sys
import adafruit_ads1x15.ads1115 as ADS import adafruit_ads1x15.ads1115 as ADS
from adafruit_ads1x15.analog_in import AnalogIn 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 parameters
""" """
nb_electrodes = 32 # maximum number of electrodes on the resistivity meter 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 functions
...@@ -66,14 +74,9 @@ def read_quad(filename, nb_elec): ...@@ -66,14 +74,9 @@ def read_quad(filename, nb_elec):
else: else:
return output return output
GPIO.setmode(GPIO.BCM) GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False) 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 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 ...@@ -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: for i in pinList:
GPIO.setup(i, GPIO.OUT) GPIO.setup(i, GPIO.OUT)
GPIO.output(i, GPIO.HIGH) 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 Reading the quadripole file
...@@ -103,7 +99,7 @@ for g in range(0,nbr_meas): # for time-lapse monitoring ...@@ -103,7 +99,7 @@ for g in range(0,nbr_meas): # for time-lapse monitoring
# call switch_mux function # call switch_mux function
switch_mux(N[i,]) 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(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(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) 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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment