Skip to content

Commit

Permalink
Merge pull request #83 from rancilio-pid/machinestate
Browse files Browse the repository at this point in the history
machinestate
  • Loading branch information
murmeltier08 authored Mar 18, 2021
2 parents e66570c + db0ddc3 commit bbfb5fe
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
1 change: 0 additions & 1 deletion rancilio-pid/Displaytemplateminimal.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ void printScreen()
unsigned long currentMillisDisplay = millis();
if
(
(currentMillisDisplay - previousMillisDisplay >= intervalDisplay) &&
(machinestate == 19 || machinestate == 20 || machinestate == 35) ||
((machinestate == 30 || machinestate == 31) && SHOTTIMER == 0) ||// shottimer == 0, auch Bezug anzeigen
((machinestate == 10) && HEATINGLOGO == 0)
Expand Down
4 changes: 1 addition & 3 deletions rancilio-pid/Displaytemplatestandard.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ void printScreen()
unsigned long currentMillisDisplay = millis();
if
(
(currentMillisDisplay - previousMillisDisplay >= intervalDisplay) &&
(machinestate == 19 || machinestate == 20 || machinestate == 35) ||
((machinestate == 30 || machinestate == 31) && SHOTTIMER == 0) ||// shottimer == 0, auch Bezug anzeigen
((machinestate == 10) && HEATINGLOGO == 0)
)
{
previousMillisDisplay = currentMillisDisplay;


u8g2.clearBuffer();
u8g2.setFont(u8g2_font_profont11_tf); // set font
u8g2.drawXBMP(0, 0, logo_width, logo_height, logo_bits_u8g2); //draw temp icon
Expand Down
3 changes: 1 addition & 2 deletions rancilio-pid/Displaytemplatetemponly.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ void printScreen()
unsigned long currentMillisDisplay = millis();
if
(
(currentMillisDisplay - previousMillisDisplay >= intervalDisplay) &&
(machinestate == 19 || machinestate == 20 || machinestate == 35) ||
((machinestate == 30 || machinestate == 31) && SHOTTIMER == 0) ||// shottimer == 0, auch Bezug anzeigen
((machinestate == 10) && HEATINGLOGO == 0)
)
{
previousMillisDisplay = currentMillisDisplay;

if (!sensorError) {
u8g2.clearBuffer();
//draw outline frame
Expand Down
3 changes: 1 addition & 2 deletions rancilio-pid/Displaytemplateupright.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ void printScreen()
unsigned long currentMillisDisplay = millis();
if
(
(currentMillisDisplay - previousMillisDisplay >= intervalDisplay) &&
(machinestate == 19 || machinestate == 20 || machinestate == 35) ||
((machinestate == 30 || machinestate == 31) && SHOTTIMER == 0) ||// shottimer == 0, auch Bezug anzeigen
((machinestate == 10) && HEATINGLOGO == 0)
)
{
previousMillisDisplay = currentMillisDisplay;

if (!sensorError) {
u8g2.clearBuffer();
u8g2.setCursor(1, 14);
Expand Down
25 changes: 16 additions & 9 deletions rancilio-pid/rancilio-pid.ino
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ DeviceAddress sensorDeviceAddress; // arrays to hold device address
uint16_t temperature = 0; // internal variable used to read temeprature
float Temperatur_C = 0; // internal variable that holds the converted temperature in °C

#if (ONE_WIRE_BUS == 16 && TEMPSENSOR == 2)
#if (ONE_WIRE_BUS == 16 && TEMPSENSOR == 2 && defined(ESP8266))
TSIC Sensor1(ONE_WIRE_BUS); // only Signalpin, VCCpin unused by default
#else
ZACwire<ONE_WIRE_BUS> Sensor2(306); // set pin "2" to receive signal from the TSic "306"
Expand Down Expand Up @@ -641,7 +641,7 @@ void refreshTemp() {
getTemperature only updates if data is valid, otherwise "temperature" will still hold old values
*/
temperature = 0;
#if (ONE_WIRE_BUS == 16)
#if (ONE_WIRE_BUS == 16 && defined(ESP8266))
Sensor1.getTemperature(&temperature);
Temperatur_C = Sensor1.calc_Celsius(&temperature);
#endif
Expand Down Expand Up @@ -1929,7 +1929,7 @@ void looppid() {
brew(); //start brewing if button pressed
checkSteamON(); // check for steam
sendToBlynk();
machinestatevoid() ; // calc machinestaze
machinestatevoid() ; // calc machinestate
if(ETRIGGER == 1) // E-Trigger active then void Etrigger()
{
ETriggervoid();
Expand All @@ -1950,14 +1950,21 @@ void looppid() {
if (!sensorError && Input > 0 && !emergencyStop && backflushState == 10 && (backflushON == 0 || brewcounter > 10)) {
brewdetection(); //if brew detected, set PID values
#if DISPLAY != 0
unsigned long currentMillisDisplay = millis();
if (currentMillisDisplay - previousMillisDisplay >= 100)
{
displayShottimer() ;
#if DISPLAYTEMPLATE < 20 // not in vertikal template
heatinglogo();
#endif
OFFlogo();
steamLogo();
printScreen(); // refresh display
}
if (currentMillisDisplay - previousMillisDisplay >= intervalDisplay) {
previousMillisDisplay = currentMillisDisplay;
#if DISPLAYTEMPLATE < 20 // not in vertikal template
heatinglogo();
OFFlogo();
steamLogo();
#endif
printScreen(); // refresh display
#endif
}
//Set PID if first start of machine detected, and no SteamON
if ((Input < BrewSetPoint) && kaltstart && SteamON == 0) {
if (startTn != 0) {
Expand Down

0 comments on commit bbfb5fe

Please sign in to comment.