This is what the python adafruit script does at startup:
It sets to 0 the calibration values but immediately sets the default mode set_calibration_32V_2A with these values assuming there is a 0.1 shunt resistor:
I will check the signal k plugins to see how they manage calibration and the possibility of checking from openplotter if they are competing for the device.
Currently openplotter users can only use the sensor for set_calibration_32V_2A with the built 0.1 shunt resistor, so I do not think anyone is using it. If you agree I could add these settings as "sensor settings" to openplotter:
_current_lsb:
float values allowed
_cal_value:
float values allowed
_power_lsb:
float values allowed
bus_voltage_range:
RANGE_16V
RANGE_32V
gain:
DIV_1_40MV
DIV_2_80MV
DIV_4_160MV
DIV_8_320MV
bus_adc_resolution:
ADCRES_9BIT_1S
ADCRES_10BIT_1S
ADCRES_11BIT_1S
ADCRES_12BIT_1S
ADCRES_12BIT_2S
ADCRES_12BIT_4S
ADCRES_12BIT_8S
ADCRES_12BIT_16S
ADCRES_12BIT_32S
ADCRES_12BIT_64S
ADCRES_12BIT_128S
shunt_adc_resolution:
same as bus_adc_resolution
mode:
POWERDOWN
SVOLT_TRIGGERED
BVOLT_TRIGGERED
SANDBVOLT_TRIGGERED
ADCOFF
SVOLT_CONTINUOUS
BVOLT_CONTINUOUS
SANDBVOLT_CONTINUOUS
The default value of these exposed variables will be set_calibration_16V_5A instead of set_calibration_32V_2A and you will be able to play with it using the html tool to calculate different modes.
Code:
self._cal_value = 0
self._current_lsb = 0
self._power_lsb = 0
self.set_calibration_32V_2A()
It sets to 0 the calibration values but immediately sets the default mode set_calibration_32V_2A with these values assuming there is a 0.1 shunt resistor:
Code:
self._cal_value = 4096
self._current_lsb = 0.1
self._power_lsb = 0.002
self.bus_voltage_range = BusVoltageRange.RANGE_32V
self.gain = Gain.DIV_8_320MV
self.bus_adc_resolution = ADCResolution.ADCRES_12BIT_1S
self.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_1S
self.mode = Mode.SANDBVOLT_CONTINUOUS
I will check the signal k plugins to see how they manage calibration and the possibility of checking from openplotter if they are competing for the device.
Currently openplotter users can only use the sensor for set_calibration_32V_2A with the built 0.1 shunt resistor, so I do not think anyone is using it. If you agree I could add these settings as "sensor settings" to openplotter:
_current_lsb:
float values allowed
_cal_value:
float values allowed
_power_lsb:
float values allowed
bus_voltage_range:
RANGE_16V
RANGE_32V
gain:
DIV_1_40MV
DIV_2_80MV
DIV_4_160MV
DIV_8_320MV
bus_adc_resolution:
ADCRES_9BIT_1S
ADCRES_10BIT_1S
ADCRES_11BIT_1S
ADCRES_12BIT_1S
ADCRES_12BIT_2S
ADCRES_12BIT_4S
ADCRES_12BIT_8S
ADCRES_12BIT_16S
ADCRES_12BIT_32S
ADCRES_12BIT_64S
ADCRES_12BIT_128S
shunt_adc_resolution:
same as bus_adc_resolution
mode:
POWERDOWN
SVOLT_TRIGGERED
BVOLT_TRIGGERED
SANDBVOLT_TRIGGERED
ADCOFF
SVOLT_CONTINUOUS
BVOLT_CONTINUOUS
SANDBVOLT_CONTINUOUS
The default value of these exposed variables will be set_calibration_16V_5A instead of set_calibration_32V_2A and you will be able to play with it using the html tool to calculate different modes.