Commit 9fcbe8a3 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Adds Continuous mode after adc_gain

Showing with 4 additions and 2 deletions
+4 -2
...@@ -46,13 +46,13 @@ if within_ohmpi: ...@@ -46,13 +46,13 @@ if within_ohmpi:
k = OhmPi() k = OhmPi()
k.reset_mux() k.reset_mux()
k._hw.switch_mux([1, 4, 2, 3], state='on') k._hw.switch_mux([1, 4, 2, 3], state='on')
k._hw.vab_square_wave(12,1) k._hw.vab_square_wave(3.,1)
k._hw.switch_mux([1, 4, 2, 3], state='off') k._hw.switch_mux([1, 4, 2, 3], state='off')
k._hw.calibrate_rx_bias() # electrodes 1 4 2 3 should be connected to a reference circuit k._hw.calibrate_rx_bias() # electrodes 1 4 2 3 should be connected to a reference circuit
print(f'Resistance: {k._hw.last_rho :.2f} ohm, dev. {k._hw.last_dev:.2f} %, rx bias: {k._hw.rx._bias:.2f} mV') print(f'Resistance: {k._hw.last_rho :.2f} ohm, dev. {k._hw.last_dev:.2f} %, rx bias: {k._hw.rx._bias:.2f} mV')
k._hw._plot_readings() k._hw._plot_readings()
k._hw.switch_mux([1, 4, 2, 3], state='on') k._hw.switch_mux([1, 4, 2, 3], state='on')
k._hw.vab_square_wave(12,1) k._hw.vab_square_wave(3.,1)
k._hw.switch_mux([1, 4, 2, 3], state='off') k._hw.switch_mux([1, 4, 2, 3], state='off')
print(f'Resistance: {k._hw.last_rho :.2f} ohm, dev. {k._hw.last_dev:.2f} %, rx bias: {k._hw.rx._bias:.2f} mV') print(f'Resistance: {k._hw.last_rho :.2f} ohm, dev. {k._hw.last_dev:.2f} %, rx bias: {k._hw.rx._bias:.2f} mV')
k._hw._plot_readings() k._hw._plot_readings()
......
...@@ -248,6 +248,7 @@ class Rx(RxAbstract): ...@@ -248,6 +248,7 @@ class Rx(RxAbstract):
self._adc_gain = value self._adc_gain = value
self._ads_voltage = ads.ADS1115(self.ctl.bus, gain=self.adc_gain, data_rate=860, self._ads_voltage = ads.ADS1115(self.ctl.bus, gain=self.adc_gain, data_rate=860,
address=self._ads_voltage_address) address=self._ads_voltage_address)
self._ads_voltage.mode = Mode.CONTINUOUS
self.exec_logger.debug(f'Setting RX ADC gain to {value}') self.exec_logger.debug(f'Setting RX ADC gain to {value}')
def adc_gain_auto(self): def adc_gain_auto(self):
......
...@@ -178,6 +178,7 @@ class OhmPiHardware: ...@@ -178,6 +178,7 @@ class OhmPiHardware:
sampling_rate = self.rx.sampling_rate sampling_rate = self.rx.sampling_rate
sample = 0 sample = 0
# self.exec_logger.info(f'values when starting pulse {self._pulse} : {self.tx.current} mA, {self.rx.voltage} mV') # self.exec_logger.info(f'values when starting pulse {self._pulse} : {self.tx.current} mA, {self.rx.voltage} mV')
# _ = self.rx.voltage
lap = datetime.datetime.utcnow() # just in case tx_sync is not set immediately after passing wait lap = datetime.datetime.utcnow() # just in case tx_sync is not set immediately after passing wait
self.tx_sync.wait() # self.tx_sync.wait() #
if not append or self._start_time is None: if not append or self._start_time is None:
......
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