|
|
@ -22,8 +22,8 @@ const float wheelDiameterInches = 20; |
|
|
|
const int numImpulsesPerTurn = 2; |
|
|
|
const int numImpulsesPerTurn = 2; |
|
|
|
const float wheelCircumferenceMeters = wheelDiameterInches * 0.0254f * 3.1415f / (float)numImpulsesPerTurn; |
|
|
|
const float wheelCircumferenceMeters = wheelDiameterInches * 0.0254f * 3.1415f / (float)numImpulsesPerTurn; |
|
|
|
|
|
|
|
|
|
|
|
int16_t batteryVoltage = -1; // in mV
|
|
|
|
uint16_t batteryVoltage = 0; // in mV
|
|
|
|
int16_t batteryCurrent = -1; // in mV
|
|
|
|
uint16_t batteryCurrent = 0; // in mV
|
|
|
|
|
|
|
|
|
|
|
|
WiFiMulti wifiMulti; |
|
|
|
WiFiMulti wifiMulti; |
|
|
|
wl_status_t wifi_STA_status = WL_NO_SHIELD; |
|
|
|
wl_status_t wifi_STA_status = WL_NO_SHIELD; |
|
|
@ -224,8 +224,8 @@ void loop() |
|
|
|
averageC = max(0.0f, averageC - 2.5f) / 0.0238f; // convert voltage to current, according to the sensor linear relation
|
|
|
|
averageC = max(0.0f, averageC - 2.5f) / 0.0238f; // convert voltage to current, according to the sensor linear relation
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: mutex ?
|
|
|
|
// TODO: mutex ?
|
|
|
|
batteryVoltage = (int16_t)(averageV * 1000.0f + 0.5f); |
|
|
|
batteryVoltage = (uint16_t)(averageV * 1000.0f + 0.5f); |
|
|
|
batteryCurrent = (int16_t)(averageC * 1000.0f + 0.5f); |
|
|
|
batteryCurrent = (uint16_t)(averageC * 1000.0f + 0.5f); |
|
|
|
|
|
|
|
|
|
|
|
delay(10); |
|
|
|
delay(10); |
|
|
|
} |
|
|
|
} |
|
|
|