Skip to content

Commit

Permalink
(fix): ticket #8 - refactured manual mode display to make digital pre…
Browse files Browse the repository at this point in the history
…ssure display optional
  • Loading branch information
mwood77 committed Jan 14, 2022
1 parent b976cf5 commit a9aae8b
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions koffie/koffie.ino
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,6 @@
float sensor = analogRead(PRESSURE_SENSOR_INPUT_PIN);
float convertedReading = convertPressureUnits(sensor);

Serial.println(convertedReading - MEASUREMENT_INPUT);

if ( (convertedReading - MEASUREMENT_INPUT) >= 2 ) {
ERROR_COUNT++;
} else {
Expand All @@ -471,7 +469,6 @@
// APPLY PID COMPUTE TO RELAY
relay.loop();

// @todo - double check relay library handling of when dutyCycle = 0%
if (MEASUREMENT_INPUT > SETPOINT) {
relay.setDutyCyclePercent(0);
relay.setRelayPosition(relayPositionOpen); // change relayPositionOpen to relayPositionClosed if your relay is normally open
Expand Down Expand Up @@ -604,22 +601,23 @@
display.fillRect(66, 20, 62, 64, BLACK);
display.setTextColor(WHITE, BLACK);

if (CURRENT_MODE == 25) {

display.setCursor(70, 28);
display.print(F("TARG "));

if (MEASUREMENT_UNIT == 'F') {
display.print(convertedSetPoint);
} else {
display.print(SETPOINT);
}

display.setCursor(70, 48);
display.print(F("ACTL "));
display.print(pressure, 2);
// *************************************************************************************
// If you want to display a digital readout of the current (unfiltered) pressure,
// uncomment the lines beneath and the closing bracket at line 640.
// *************************************************************************************

} else {
// if (CURRENT_MODE == 25) {
// display.setCursor(70, 28);
// display.print(F("TARG "));
// if (MEASUREMENT_UNIT == 'F') {
// display.print(convertedSetPoint);
// } else {
// display.print(SETPOINT);
// }
// display.setCursor(70, 48);
// display.print(F("ACTL "));
// display.print(pressure, 2);
// } else {

display.setTextSize(2);
display.setCursor(74, 35);
Expand All @@ -639,7 +637,7 @@
display.print(F("BAR"));
}

}
// }

display.display();

Expand Down

0 comments on commit a9aae8b

Please sign in to comment.