Commit be304324 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Allows for several gain ratios with DG411 in mb_2024

Showing with 2 additions and 1 deletion
+2 -1
...@@ -21,6 +21,7 @@ SPECS = {'rx': {'model': {'default': os.path.basename(__file__).rstrip('.py')}, ...@@ -21,6 +21,7 @@ SPECS = {'rx': {'model': {'default': os.path.basename(__file__).rstrip('.py')},
'mcp_address': {'default': 0x27}, 'mcp_address': {'default': 0x27},
'ads_address': {'default': 0x49}, 'ads_address': {'default': 0x49},
'voltage_min': {'default': 10.0}, 'voltage_min': {'default': 10.0},
'dg411_gain_ratio': 1/2, # lowest resitor value over sum of resistor values
'vmn_hardware_offset': {'default': 2500.}, 'vmn_hardware_offset': {'default': 2500.},
}, },
'tx': {'model': {'default': os.path.basename(__file__).rstrip('.py')}, 'tx': {'model': {'default': os.path.basename(__file__).rstrip('.py')},
...@@ -144,7 +145,7 @@ class Rx(Rx_mb_2023): ...@@ -144,7 +145,7 @@ class Rx(Rx_mb_2023):
# ADS1115 for voltage measurement (MN) # ADS1115 for voltage measurement (MN)
self._coef_p2 = 1. self._coef_p2 = 1.
# Define default DG411 gain # Define default DG411 gain
self._dg411_gain = 1/2 self._dg411_gain = kwargs['dg411_gain_ratio']
# Define pins for DG411 # Define pins for DG411
self.pin_DG0 = self.mcp_board.get_pin(0) self.pin_DG0 = self.mcp_board.get_pin(0)
self.pin_DG0.direction = Direction.OUTPUT self.pin_DG0.direction = Direction.OUTPUT
......
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