From edb38db8e377fbcf38ffe05802f47cd1aa3bb492 Mon Sep 17 00:00:00 2001 From: "nicolas.forquet" <nicolas.forquet@irstea.fr> Date: Mon, 16 Nov 2020 16:18:09 +0100 Subject: [PATCH] the hardware parameters have been remove from the json file and put back in the may code. the export path is now an absolute path. --- ohmpi.py | 11 ++++++++++- ohmpi_param.json | 7 +------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ohmpi.py b/ohmpi.py index 109d897a..2de289f4 100644 --- a/ohmpi.py +++ b/ohmpi.py @@ -157,6 +157,15 @@ for i in pinList: GPIO.setup(i, GPIO.OUT) GPIO.output(i, GPIO.HIGH) +""" +Hardware parameters +""" +R_ref = 50 # reference resistance value in ohm +coef_p0 = 2.5 # slope for the current conversion for ADS.P0, measurement in V/V +coef_p1 = 2.5 # slope for the current conversion for ADS.P1, measurement in V/V +coef_p2 = 2.5 # slope for the current conversion for ADS.P2, measurement in V/V +coef_p3 = 2.5 # slope for the current conversion for ADS.P3, measurement in V/V + """ Main loop """ @@ -169,7 +178,7 @@ for g in range(0,pardict.get("nbr_meas")): # for time-lapse monitoring switch_mux(N[i,]) # run a measurement - current_measurement = run_measurement(pardict.get("stack"), pardict.get("injection_duration"), pardict.get("R_ref"), pardict.get("coef_p0"), pardict.get("coef_p1"), pardict.get("coef_p2"), pardict.get("coef_p3"), N[i,]) + current_measurement = run_measurement(pardict.get("stack"), pardict.get("injection_duration"), R_ref, coef_p0, coef_p1, coef_p2, coef_p3, N[i,]) # save data and print in a text file append_and_save(pardict.get("export_path"), current_measurement) diff --git a/ohmpi_param.json b/ohmpi_param.json index 32eb1907..4c6b5efc 100644 --- a/ohmpi_param.json +++ b/ohmpi_param.json @@ -4,10 +4,5 @@ "nbr_meas": 1, "sequence_delay": 30, "stack": 1, - "R_ref": 50, - "coef_p0": 2.02, - "coef_p1": 2.02, - "coef_p2": 1, - "coef_p3": 1, - "export_path": "~/measurement.csv" + "export_path": "home/pi/Desktop/measurement.csv" } \ No newline at end of file -- GitLab