Commit 310d50e7 authored by Arnaud WATLET's avatar Arnaud WATLET
Browse files

Updates components for tests

Showing with 12 additions and 4 deletions
+12 -4
...@@ -240,10 +240,10 @@ class Rx(RxAbstract): ...@@ -240,10 +240,10 @@ class Rx(RxAbstract):
# ADS1115 for voltage measurement (MN) # ADS1115 for voltage measurement (MN)
self._ads_voltage_address = kwargs['ads_address'] self._ads_voltage_address = kwargs['ads_address']
self._adc_gain = 2/3 self._adc_gain = 2/3
self._ads_voltage = ads.ADS1115(self.connection, gain=self._adc_gain,
data_rate=SPECS['rx']['data_rate']['default'], if connect:
address=self._ads_voltage_address) self.reset_ads(mode=Mode.CONTINUOUS)
self._ads_voltage.mode = Mode.CONTINUOUS
self._coef_p2 = kwargs['coef_p2'] self._coef_p2 = kwargs['coef_p2']
# self._voltage_max = kwargs['voltage_max'] # self._voltage_max = kwargs['voltage_max']
self._sampling_rate = kwargs['sampling_rate'] self._sampling_rate = kwargs['sampling_rate']
...@@ -278,6 +278,11 @@ class Rx(RxAbstract): ...@@ -278,6 +278,11 @@ class Rx(RxAbstract):
def reset_gain(self): def reset_gain(self):
self.gain = 2/3 self.gain = 2/3
def reset_ads(self, mode=Mode.CONTINUOUS):
self._ads_current = ads.ADS1115(self.connection, gain=self._adc_gain, data_rate=self._ads_current_data_rate,
address=self._ads_current_address)
self._ads_voltage.mode = mode
@property @property
def voltage(self): def voltage(self):
""" Gets the voltage VMN in Volts """ Gets the voltage VMN in Volts
......
...@@ -203,6 +203,9 @@ class Rx(Rx_mb_2023): ...@@ -203,6 +203,9 @@ class Rx(Rx_mb_2023):
def reset_gain(self): def reset_gain(self):
self.gain = 1/3 self.gain = 1/3
def reset_mcp(self):
self.mcp_board = MCP23008(self.connection, address=self._mcp_address)
@property @property
def voltage(self): def voltage(self):
""" Gets the voltage VMN in Volts """ Gets the voltage VMN in Volts
......
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