current conversion
This commit is contained in:
parent
a18274bec0
commit
3efc86edf4
@ -5,4 +5,5 @@
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t refresh_delay;
|
uint32_t refresh_delay;
|
||||||
uint32_t* offsets;
|
uint32_t* offsets;
|
||||||
|
int range;
|
||||||
} configuration;
|
} configuration;
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
static struct char_pres_format current_char_pres_format = {
|
static struct char_pres_format current_char_pres_format = {
|
||||||
.format = FORMAT_UINT32,
|
.format = FORMAT_UINT32,
|
||||||
.exponent = -3,
|
.exponent = -6,
|
||||||
.unit = AMPERE_UNIT_UUID,
|
.unit = AMPERE_UNIT_UUID,
|
||||||
.namespc = 1,
|
.namespc = 1,
|
||||||
.descrH = NSP_DESC_MAIN & 0xff,
|
.descrH = NSP_DESC_MAIN & 0xff,
|
||||||
|
@ -125,6 +125,7 @@ void app_main(void){
|
|||||||
configuration main_conf = {
|
configuration main_conf = {
|
||||||
.refresh_delay = 1000,
|
.refresh_delay = 1000,
|
||||||
.offsets = offsets,
|
.offsets = offsets,
|
||||||
|
.range = R100,
|
||||||
};
|
};
|
||||||
|
|
||||||
uint32_t meas_volts[INPUTS_NUM];
|
uint32_t meas_volts[INPUTS_NUM];
|
||||||
@ -157,6 +158,7 @@ void app_main(void){
|
|||||||
ESP_ERROR_CHECK(adc_cali_raw_to_voltage(adc_conv_h[i], val, &mv));
|
ESP_ERROR_CHECK(adc_cali_raw_to_voltage(adc_conv_h[i], val, &mv));
|
||||||
ESP_LOGI(TAG, "IN %d : %d mV (%lu / %lu)", i, mv, meas_res_buff[i], meas_nb_buff[i]);
|
ESP_LOGI(TAG, "IN %d : %d mV (%lu / %lu)", i, mv, meas_res_buff[i], meas_nb_buff[i]);
|
||||||
meas_volts[i] = mv;
|
meas_volts[i] = mv;
|
||||||
|
meas_amp[i] = mv * 1000000 / ranges[main_conf.range].resistance;
|
||||||
}
|
}
|
||||||
|
|
||||||
notify_update(&meas);
|
notify_update(&meas);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user