From e2b12e8794788bdd082bbd56e9c3fa680f97835a Mon Sep 17 00:00:00 2001 From: Amado Antonini Date: Thu, 26 Mar 2020 03:07:21 -0400 Subject: [PATCH 1/2] remove unnecessary clear char --- Display.cpp | 20 ++++++++------------ Display.h | 2 +- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Display.cpp b/Display.cpp index c609e0e..b010d23 100644 --- a/Display.cpp +++ b/Display.cpp @@ -9,19 +9,19 @@ void Display::begin() { } void Display::writeHeader(){ - write(0, 0, "Set: P(cmH2O):", 20); + write(0, 0, "Set: P(cmH2O):"); } void Display::writeVolume(const int& vol){ char buff[12]; sprintf(buff, " V=%2d%% max ", vol); - write(1, 0, buff, 11); + write(1, 0, buff); } void Display::writeBPM(const int& bpm){ char buff[12]; sprintf(buff, " RR=%2d/min ", bpm); - write(2, 0, buff, 11); + write(2, 0, buff); } void Display::writeIEratio(const float& ie){ @@ -29,33 +29,29 @@ void Display::writeIEratio(const float& ie){ dtostrf(ie, 3, 1, ie_buff); char buff[12]; sprintf(buff, " I:E=1:%s ", ie_buff); - write(3, 0, buff, 11); + write(3, 0, buff); } void Display::writePeakP(const int& peak){ char buff[10]; sprintf(buff, " peak=%2d", peak); - write(1, 11, buff, 9); + write(1, 11, buff); } void Display::writePlateauP(const int& plat){ char buff[10]; sprintf(buff, " plat=%2d", plat); - write(2, 11, buff, 9); + write(2, 11, buff); } void Display::writePEEP(const int& peep){ char buff[10]; sprintf(buff, " PEEP=%2d", peep); - write(3, 11, buff, 9); + write(3, 11, buff); } template -void Display::write(const int& row, const int& col, const T& printable, const int& width){ - for(int i=0; isetCursor(col + i, row); - lcd_->write(' '); - } +void Display::write(const int& row, const int& col, const T& printable){ lcd_->setCursor(col, row); lcd_->print(printable); } diff --git a/Display.h b/Display.h index 51eb056..7e26df5 100644 --- a/Display.h +++ b/Display.h @@ -39,7 +39,7 @@ class Display { LiquidCrystal* lcd_; template - void write(const int& row, const int& col, const T& printable, const int& width); + void write(const int& row, const int& col, const T& printable); }; From 3d97f4bb3a76c1a7430410319268dad0d29d5de8 Mon Sep 17 00:00:00 2001 From: Amado Antonini Date: Thu, 26 Mar 2020 03:12:56 -0400 Subject: [PATCH 2/2] add missing set_peep --- e-vent.ino | 1 + 1 file changed, 1 insertion(+) diff --git a/e-vent.ino b/e-vent.ino index 46f364b..8b39b50 100644 --- a/e-vent.ino +++ b/e-vent.ino @@ -231,6 +231,7 @@ void loop() { if(millis()-stateTimer > Tex*1000){ pressure.set_peak_and_reset(); + pressure.set_peep(); displ.writePeakP(pressure.peak()); displ.writePEEP(pressure.peep()); displ.writePlateauP(pressure.plateau());