cosmetic improvements

This commit is contained in:
interfisch 2023-06-03 12:59:26 +02:00
parent 2991bf8c07
commit e82675c36d
2 changed files with 11 additions and 5 deletions

View File

@ -120,10 +120,9 @@ void display_drivingDisplay(ESCSerialComm& escFront, ESCSerialComm& escRear) {
display.print("km/h"); display.print("km/h");
//A //A
display.setCursor(SCREEN_WIDTH-35,1);
display.setCursor(SCREEN_WIDTH-30,1);
static float averaged_filtered_currentAll; static float averaged_filtered_currentAll;
#define CURRENT_FILTER 0.95 #define CURRENT_FILTER 0.8
averaged_filtered_currentAll=averaged_filtered_currentAll*CURRENT_FILTER+(1-CURRENT_FILTER)*filtered_currentAll; //filter over time averaged_filtered_currentAll=averaged_filtered_currentAll*CURRENT_FILTER+(1-CURRENT_FILTER)*filtered_currentAll; //filter over time
dtostrf(averaged_filtered_currentAll,1,2,buf); dtostrf(averaged_filtered_currentAll,1,2,buf);
strbuf=buf; strbuf=buf;
@ -142,12 +141,14 @@ void display_drivingDisplay(ESCSerialComm& escFront, ESCSerialComm& escRear) {
dtostrf(max_meanSpeed*3.6,1,0,buf); dtostrf(max_meanSpeed*3.6,1,0,buf);
display.print((String)buf); display.print((String)buf);
display.print("max: ");
display.print("km/h"); display.print("km/h");
}else{ }else{
//## Current Consumed //## Current Consumed
dtostrf(min_filtered_currentAll,1,1,buf); dtostrf(min_filtered_currentAll,1,1,buf);
display.print("min: ");
display.print((String)buf); display.print((String)buf);
display.print("A / "); display.print("A, max: ");
dtostrf(max_filtered_currentAll,1,1,buf); dtostrf(max_filtered_currentAll,1,1,buf);
display.print((String)buf); display.print((String)buf);
@ -198,6 +199,7 @@ void display_standingDisplay(ESCSerialComm& escFront, ESCSerialComm& escRear) {
display.print(F("Cons. ")); display.print(F("Cons. "));
dtostrf(escFront.getCurrentConsumed()+escRear.getCurrentConsumed(),1,2,buf); dtostrf(escFront.getCurrentConsumed()+escRear.getCurrentConsumed(),1,2,buf);
display.print((String)buf); display.print((String)buf);
display.print(" Ah");
display.println(); display.println();
} }

View File

@ -116,7 +116,11 @@ void led_update(unsigned long loopmillis,ESCSerialComm& escFront, ESCSerialComm&
}else{ }else{
//Driving //Driving
float currentMean=escRear.getFiltered_curL()+escRear.getFiltered_curR()+escFront.getFiltered_curL()+escFront.getFiltered_curR(); float currentMean=escRear.getFiltered_curL()+escRear.getFiltered_curR()+escFront.getFiltered_curL()+escFront.getFiltered_curR();
led_gauge(loopmillis,currentMean,0,16.0,strip.Color(0, 0, 0, 255),strip.Color(0, 0, 20, 0)); uint32_t _bgColor=strip.Color(0, 0, 20, 0);
if (reverse_enabled) {
_bgColor=strip.Color(20, 0, 20, 0);
}
led_gauge(loopmillis,currentMean,0,16.0,strip.Color(0, 0, 0, 255),_bgColor);
} }
}else{ }else{
//Disarmed //Disarmed