diff --git a/mini-beieli-node.ino b/mini-beieli-node.ino index cefd109..166a22e 100644 --- a/mini-beieli-node.ino +++ b/mini-beieli-node.ino @@ -655,7 +655,7 @@ void ReadSensors(SENSOR_data &sensor_data) { // Gewicht berechnen weight_current32 = (int32_t)((((res.weight1 - w1_0_real) / config_data.cal_w1_factor) + ((res.weight2 - w2_0_real) / config_data.cal_w2_factor)) / 5.0); - + if (weight_current32 < 0) { weight_current32 = 0; } else if (weight_current32 > UINT16_MAX) { @@ -1364,7 +1364,7 @@ cCommandStream::CommandStatus cmdCalibrateScaleA(cCommandStream *pThis, void *pC if (w1_gramm == "NA") { // scale a is not connected - config_data.cal_w1_factor = 0.0; + config_data.cal_w1_factor = 1.0; config_data.cal_w1_0 = NOT_ATTACHED; } else { setup_scales(); @@ -1386,7 +1386,7 @@ cCommandStream::CommandStatus cmdCalibrateScaleB(cCommandStream *pThis, void *pC if (w2_gramm == "NA") { // scale b is not connected - config_data.cal_w2_factor = 0.0; + config_data.cal_w2_factor = 1.0; config_data.cal_w2_0 = NOT_ATTACHED; } else { setup_scales();