From e9dd297a7856ae50c9fe1d62e1931bec4f713a68 Mon Sep 17 00:00:00 2001 From: jlino Date: Sat, 24 Jun 2017 16:52:26 +0100 Subject: [PATCH] fixed bugs and set trigo as default profile fixed bugs and set trigo as default profile --- Display.cpp | 322 ++----------------------------------------------- Display.h | 5 - Melody.cpp | 32 ++++- Melody.h | 3 +- Profiles.h | 339 +++++++++++++++++++++++++++------------------------- brew.h | 4 + brew.ino | 307 +++++++++++++++++++++++++++++++++++++---------- config.h | 10 +- 8 files changed, 472 insertions(+), 550 deletions(-) diff --git a/Display.cpp b/Display.cpp index 9486380..3339862 100644 --- a/Display.cpp +++ b/Display.cpp @@ -8,6 +8,9 @@ boolean lcdPrint(LiquidCrystal_I2C *lcd, String title, String message) { int messageLength = message.length(); + /*unsigned long timeToReadTheMessage = messageLength * 16; + unsigned long numberOfTimeDivisions = messageLength - LCD_HORIZONTAL_RESOLUTION; + int messagePosition(millis()%timeToReadTheMessage)/numberOfTimeDivisions*/ lcd->clear(); @@ -19,7 +22,7 @@ boolean lcdPrint(LiquidCrystal_I2C *lcd, String title, String message) { if(messageLength <= LCD_HORIZONTAL_RESOLUTION) { lcd->setCursor(0,LCD_VERTICAL_RESOLUTION-1); lcd->print(message); - delay(1000); + delay(50); } // print scrolling message else { @@ -35,19 +38,13 @@ boolean lcdPrint(LiquidCrystal_I2C *lcd, String title, String message) { // print scrolling message for (int cursor = 0; cursor < messageLength - LCD_HORIZONTAL_RESOLUTION; cursor+=2) { - if ((digitalRead(ROTARY_ENCODER_SW_PIN))) { - // Wait until switch is released - while (digitalRead(ROTARY_ENCODER_SW_PIN)) {} - - // debounce - delay(10); - - // Job is done, break the circle - return false; + if ((digitalRead(ROTARY_ENCODER_SW_PIN))) { + while (digitalRead(ROTARY_ENCODER_SW_PIN)) {} // Wait until switch is released + return false; // Job is done, break the circle } else { lcd->setCursor(0,LCD_VERTICAL_RESOLUTION-1); lcd->print(output_message.substring(cursor, cursor+16)); - delay(500); + delay(250); } } } @@ -177,306 +174,3 @@ boolean displayGenericMenu( LiquidCrystal_I2C *lcd, MenuData *data ) { return repaintRequired; } -boolean displayMainMenu(LiquidCrystal_I2C *lcd, eMainMenuOptions position, boolean repaint) { - boolean ret = repaint; - - if(repaint) { - // display menu - lcd->clear(); - lcd->home (); // go home - lcd->print("Brewery Menu"); - - switch(position) { - case eMainMenu_GO_FROM_STAGE: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> GO FROM STAGE"); - break; - } - case eMainMenu_GO: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> GO "); - break; - } - case eMainMenu_STOP: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> STOP "); - break; - } - case eMainMenu_SKIP: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> SKIP "); - break; - } - case eMainMenu_BeerProfile: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> BeerProfile "); - break; - } - case eMainMenu_Stage: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Stages "); - break; - } - case eMainMenu_Malt: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Malt "); - break; - } - case eMainMenu_Hops: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Hops "); - break; - } - case eMainMenu_Clean: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Clean "); - break; - } - case eMainMenu_Purge: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Purge "); - break; - } - case eMainMenu_Settings: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Settings "); - break; - } - case eMainMenu_Back: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Back "); - break; - } - default: { - // reset operation state | INPUT : eRotaryEncoderMode newMode, int newPosition, int newMaxPosition, int newMinPosition, int newSingleStep, int newMultiStep - //xSetupRotaryEncoder( eRotaryEncoderMode_Menu, eMainMenu_GO, MENU_SIZE_MAIN_MENU - 1, 0, 1, 0 ); - } - } - - ret = false; - } - - return ret; -} - -boolean displayBeerProfileMenu(LiquidCrystal_I2C *lcd, eBeerProfileMenuOptions position, boolean repaint) { - boolean ret = repaint; - - if(repaint) { - // display menu - lcd->clear(); - lcd->home (); // go home - lcd->print("Preset Menu"); - - switch(position) { - case eBeerProfileMenu_Basic: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Basic "); - break; - } - case eBeerProfileMenu_Trigo: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Trigo "); - break; - } - case eBeerProfileMenu_IPA: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> IPA "); - break; - } - case eBeerProfileMenu_Belga: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Belga "); - break; - } - case eBeerProfileMenu_Red: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Red "); - break; - } - case eBeerProfileMenu_APA: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> APA "); - break; - } - case eBeerProfileMenu_Custom: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Custom "); - break; - } - case eBeerProfileMenu_Back: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Back "); - break; - } - default: { - // reset operation state | INPUT : eRotaryEncoderMode newMode, int newPosition, int newMaxPosition, int newMinPosition, int newSingleStep, int newMultiStep - //xSetupRotaryEncoder( eRotaryEncoderMode_Menu, eMainMenu_GO, MENU_SIZE_MAIN_MENU - 1, 0, 1, 0 ); - } - } - - ret = false; - } - - return ret; -} -boolean displayStageMenu(LiquidCrystal_I2C *lcd, eStageMenuOptions position, boolean repaint) { - boolean ret = repaint; - - if(repaint) { - // display menu - lcd->clear(); - lcd->home (); // go home - lcd->print("Stage Menu"); - - switch(position) { - case eStageMenu_Startpoint: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Startpoint "); - break; - } - case eStageMenu_BetaGlucanase: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> BetaGlucanase"); - break; - } - case eStageMenu_Debranching: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Debranching "); - break; - } - case eStageMenu_Proteolytic: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Proteolytic "); - break; - } - case eStageMenu_BetaAmylase: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Beta Amylase "); - break; - } - case eStageMenu_AlphaAmylase: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Alpha Amylase"); - break; - } - case eStageMenu_Mashout: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Mashout "); - break; - } - case eStageMenu_Recirculation: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Recirculation"); - break; - } - case eStageMenu_Sparge: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Sparge "); - break; - } - case eStageMenu_Boil: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Boil "); - break; - } - case eStageMenu_Cooling: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Cooling "); - break; - } - case eStageMenu_Back: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Back "); - break; - } - default: { - // reset operation state | INPUT : eRotaryEncoderMode newMode, int newPosition, int newMaxPosition, int newMinPosition, int newSingleStep, int newMultiStep - //xSetupRotaryEncoder( eRotaryEncoderMode_Menu, eMainMenu_GO, MENU_SIZE_MAIN_MENU - 1, 0, 1, 0 ); - } - } - - ret = false; - } - - return ret; -} - -boolean displayMaltMenu(LiquidCrystal_I2C *lcd, eMaltMenuOptions position, boolean repaint) { - boolean ret = repaint; - - if(repaint) { - // display menu - lcd->clear(); - lcd->home (); // go home - lcd->print("Malt Menu"); - - switch(position) { - case eMaltMenu_CastleMalting_Chteau_Pilsen_2RS: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> CM Ch. Pilsen"); - break; - } - case eMaltMenu_CastleMalting_Wheat_Blanc: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> CM Wheat Blan"); - break; - } - case eMaltMenu_Back: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Back "); - break; - } - default: { - // reset operation state | INPUT : eRotaryEncoderMode newMode, int newPosition, int newMaxPosition, int newMinPosition, int newSingleStep, int newMultiStep - //xSetupRotaryEncoder( eRotaryEncoderMode_Menu, eMainMenu_GO, MENU_SIZE_MAIN_MENU - 1, 0, 1, 0 ); - } - } - - ret = false; - } - - return ret; -} - -boolean displaySettingsMenu(LiquidCrystal_I2C *lcd, eSettingsMenuOptions position, boolean repaint) { - boolean ret = repaint; - - if(repaint) { - // display menu - lcd->clear(); - lcd->home (); // go home - lcd->print("Settings Menu"); - - switch(position) { - case eSettingsMenu_PT100_Element: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> PT100 Element"); - break; - } - case eSettingsMenu_PT100_Up: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> PT100 Up "); - break; - } - case eSettingsMenu_PT100_Down: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> PT100 Down "); - break; - } - case eSettingsMenu_Back: { - lcd->setCursor (0,1); // go to start of 2nd line - lcd->print("-> Back "); - break; - } - default: { - // reset operation state | INPUT : eRotaryEncoderMode newMode, int newPosition, int newMaxPosition, int newMinPosition, int newSingleStep, int newMultiStep - //xSetupRotaryEncoder( eRotaryEncoderMode_Menu, eMainMenu_GO, MENU_SIZE_MAIN_MENU - 1, 0, 1, 0 ); - } - } - - ret = false; - } - - return ret; -} diff --git a/Display.h b/Display.h index d15ef34..0682fca 100644 --- a/Display.h +++ b/Display.h @@ -23,10 +23,5 @@ void xPaintStatusTemplate(LiquidCrystal_I2C *lcd, boolean cooking); boolean displayStatus(LiquidCrystal_I2C *lcd, boolean cooking, float cookTemperature, float baseTemperature, float upTemperature, float downTemperature, unsigned long clockCounter, boolean repaint); boolean displayGenericMenu( LiquidCrystal_I2C *lcd, MenuData *data ); -boolean displayMainMenu(LiquidCrystal_I2C *lcd, eMainMenuOptions position, boolean repaint); -boolean displayBeerProfileMenu(LiquidCrystal_I2C *lcd, eBeerProfileMenuOptions position, boolean repaint); -boolean displayStageMenu(LiquidCrystal_I2C *lcd, eStageMenuOptions position, boolean repaint); -boolean displayMaltMenu(LiquidCrystal_I2C *lcd, eMaltMenuOptions position, boolean repaint); -boolean displaySettingsMenu(LiquidCrystal_I2C *lcd, eSettingsMenuOptions position, boolean repaint); #endif diff --git a/Melody.cpp b/Melody.cpp index 8efe179..e9095c6 100644 --- a/Melody.cpp +++ b/Melody.cpp @@ -139,6 +139,14 @@ int buzz_1_tempo[] = { 12, 12, 12, 12, }; +int buzz_2_melody[] = { + NOTE_E7 +}; +//Mario main them tempo +int buzz_2_tempo[] = { + 12 +}; + int song = 0; void buzz(int targetPin, long frequency, long length) { @@ -271,6 +279,28 @@ void sing(int s, int pin) { } break; } + case BUZZ_2: { + int size = sizeof(buzz_2_melody) / sizeof(int); + for (int thisNote = 0; thisNote < size; thisNote++) { + + // to calculate the note duration, take one second + // divided by the note type. + //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc. + int noteDuration = 1000 / buzz_2_tempo[thisNote]; + + buzz(pin, buzz_2_melody[thisNote], noteDuration); + + // to distinguish the notes, set a minimum time between them. + // the note's duration + 30% seems to work well: + int pauseBetweenNotes = noteDuration * 1.30; + delay(pauseBetweenNotes); + + // stop the tone playing: + buzz(pin, 0, noteDuration); + + } + break; + } } -} \ No newline at end of file +} diff --git a/Melody.h b/Melody.h index 78612a8..b5af4e6 100644 --- a/Melody.h +++ b/Melody.h @@ -108,6 +108,7 @@ #define MELODY_SUPER_MARIO_START 3 #define MELODY_UNDERWORLD_SHORT 4 #define BUZZ_1 5 +#define BUZZ_2 6 // melody[] is an array of notes, accompanied by beats[], @@ -117,4 +118,4 @@ void buzz(int targetPin, long frequency, long length); void sing(int s, int pin); -#endif \ No newline at end of file +#endif diff --git a/Profiles.h b/Profiles.h index a2e5aae..24f6053 100644 --- a/Profiles.h +++ b/Profiles.h @@ -2,184 +2,199 @@ #define __PROFILES // BASIC -#define PROFILE_BASIC_STARTPOINT_TIME 120; -#define PROFILE_BASIC_BETAGLUCANASE_TIME 0; -#define PROFILE_BASIC_DEBRANCHING_TIME 0; -#define PROFILE_BASIC_PROTEOLYTIC_TIME 0; -#define PROFILE_BASIC_BETAAMYLASE_TIME 3600; -#define PROFILE_BASIC_ALPHAAMYLASE_TIME 1800; -#define PROFILE_BASIC_MASHOUT_TIME 300; -#define PROFILE_BASIC_RECIRCULATION_TIME 1200; -#define PROFILE_BASIC_SPARGE_TIME 1200; -#define PROFILE_BASIC_BOIL_TIME 5400; -#define PROFILE_BASIC_COOLING_TIME 120; - -#define PROFILE_BASIC_STARTPOINT_TEMPERATURE 30; -#define PROFILE_BASIC_BETAGLUCANASE_TEMPERATURE 40; -#define PROFILE_BASIC_DEBRANCHING_TEMPERATURE 40; -#define PROFILE_BASIC_PROTEOLYTIC_TEMPERATURE 50; -#define PROFILE_BASIC_BETAAMYLASE_TEMPERATURE 60; -#define PROFILE_BASIC_ALPHAAMYLASE_TEMPERATURE 70; -#define PROFILE_BASIC_MASHOUT_TEMPERATURE 80; -#define PROFILE_BASIC_RECIRCULATION_TEMPERATURE 80; -#define PROFILE_BASIC_SPARGE_TEMPERATURE 80; -#define PROFILE_BASIC_BOIL_TEMPERATURE 100; -#define PROFILE_BASIC_COOLING_TEMPERATURE 25; +#define PROFILE_BASIC_STARTPOINT_TIME 120 +#define PROFILE_BASIC_BETAGLUCANASE_TIME 0 +#define PROFILE_BASIC_DEBRANCHING_TIME 0 +#define PROFILE_BASIC_PROTEOLYTIC_TIME 0 +#define PROFILE_BASIC_BETAAMYLASE_TIME 3600 +#define PROFILE_BASIC_ALPHAAMYLASE_TIME 1800 +#define PROFILE_BASIC_MASHOUT_TIME 300 +#define PROFILE_BASIC_RECIRCULATION_TIME 1200 +#define PROFILE_BASIC_SPARGE_TIME 1200 +#define PROFILE_BASIC_BOIL_TIME 5400 +#define PROFILE_BASIC_COOLING_TIME 120 + +#define PROFILE_BASIC_STARTPOINT_TEMPERATURE 30 +#define PROFILE_BASIC_BETAGLUCANASE_TEMPERATURE 40 +#define PROFILE_BASIC_DEBRANCHING_TEMPERATURE 40 +#define PROFILE_BASIC_PROTEOLYTIC_TEMPERATURE 50 +#define PROFILE_BASIC_BETAAMYLASE_TEMPERATURE 60 +#define PROFILE_BASIC_ALPHAAMYLASE_TEMPERATURE 70 +#define PROFILE_BASIC_MASHOUT_TEMPERATURE 80 +#define PROFILE_BASIC_RECIRCULATION_TEMPERATURE 80 +#define PROFILE_BASIC_SPARGE_TEMPERATURE 80 +#define PROFILE_BASIC_BOIL_TEMPERATURE 100 +#define PROFILE_BASIC_COOLING_TEMPERATURE 25 // TRIGO -#define PROFILE_TRIGO_STARTPOINT_TIME PROFILE_BASIC_STARTPOINT_TIME; -#define PROFILE_TRIGO_BETAGLUCANASE_TIME PROFILE_BASIC_BETAGLUCANASE_TIME; -#define PROFILE_TRIGO_DEBRANCHING_TIME PROFILE_BASIC_DEBRANCHING_TIME; -#define PROFILE_TRIGO_PROTEOLYTIC_TIME PROFILE_BASIC_PROTEOLYTIC_TIME; -#define PROFILE_TRIGO_BETAAMYLASE_TIME PROFILE_BASIC_BETAAMYLASE_TIME; -#define PROFILE_TRIGO_ALPHAAMYLASE_TIME PROFILE_BASIC_ALPHAAMYLASE_TIME; -#define PROFILE_TRIGO_MASHOUT_TIME PROFILE_BASIC_MASHOUT_TIME; -#define PROFILE_TRIGO_RECIRCULATION_TIME PROFILE_BASIC_RECIRCULATION_TIME; -#define PROFILE_TRIGO_SPARGE_TIME PROFILE_BASIC_SPARGE_TIME; -#define PROFILE_TRIGO_BOIL_TIME PROFILE_BASIC_BOIL_TIME; -#define PROFILE_TRIGO_COOLING_TIME PROFILE_BASIC_COOLING_TIME; - -#define PROFILE_TRIGO_STARTPOINT_TEMPERATURE 45; -#define PROFILE_TRIGO_BETAGLUCANASE_TEMPERATURE PROFILE_BASIC_BETAGLUCANASE_TEMPERATURE; -#define PROFILE_TRIGO_DEBRANCHING_TEMPERATURE PROFILE_BASIC_DEBRANCHING_TEMPERATURE; -#define PROFILE_TRIGO_PROTEOLYTIC_TEMPERATURE PROFILE_BASIC_PROTEOLYTIC_TEMPERATURE; -#define PROFILE_TRIGO_BETAAMYLASE_TEMPERATURE 62; -#define PROFILE_TRIGO_ALPHAAMYLASE_TEMPERATURE PROFILE_BASIC_ALPHAAMYLASE_TEMPERATURE; -#define PROFILE_TRIGO_MASHOUT_TEMPERATURE 78; -#define PROFILE_TRIGO_RECIRCULATION_TEMPERATURE PROFILE_BASIC_RECIRCULATION_TEMPERATURE; -#define PROFILE_TRIGO_SPARGE_TEMPERATURE PROFILE_BASIC_SPARGE_TEMPERATURE; -#define PROFILE_TRIGO_BOIL_TEMPERATURE PROFILE_BASIC_BOIL_TEMPERATURE; -#define PROFILE_TRIGO_COOLING_TEMPERATURE PROFILE_BASIC_COOLING_TEMPERATURE; - +#define PROFILE_TRIGO_STARTPOINT_TIME PROFILE_BASIC_STARTPOINT_TIME +#define PROFILE_TRIGO_BETAGLUCANASE_TIME PROFILE_BASIC_BETAGLUCANASE_TIME +#define PROFILE_TRIGO_DEBRANCHING_TIME PROFILE_BASIC_DEBRANCHING_TIME +#define PROFILE_TRIGO_PROTEOLYTIC_TIME PROFILE_BASIC_PROTEOLYTIC_TIME +#define PROFILE_TRIGO_BETAAMYLASE_TIME PROFILE_BASIC_BETAAMYLASE_TIME +#define PROFILE_TRIGO_ALPHAAMYLASE_TIME PROFILE_BASIC_ALPHAAMYLASE_TIME +#define PROFILE_TRIGO_MASHOUT_TIME PROFILE_BASIC_MASHOUT_TIME +#define PROFILE_TRIGO_RECIRCULATION_TIME PROFILE_BASIC_RECIRCULATION_TIME +#define PROFILE_TRIGO_SPARGE_TIME PROFILE_BASIC_SPARGE_TIME +#define PROFILE_TRIGO_BOIL_TIME PROFILE_BASIC_BOIL_TIME +#define PROFILE_TRIGO_COOLING_TIME PROFILE_BASIC_COOLING_TIME + +#define PROFILE_TRIGO_STARTPOINT_TEMPERATURE 65 +#define PROFILE_TRIGO_BETAGLUCANASE_TEMPERATURE PROFILE_BASIC_BETAGLUCANASE_TEMPERATURE +#define PROFILE_TRIGO_DEBRANCHING_TEMPERATURE PROFILE_BASIC_DEBRANCHING_TEMPERATURE +#define PROFILE_TRIGO_PROTEOLYTIC_TEMPERATURE PROFILE_BASIC_PROTEOLYTIC_TEMPERATURE +#define PROFILE_TRIGO_BETAAMYLASE_TEMPERATURE 62 +#define PROFILE_TRIGO_ALPHAAMYLASE_TEMPERATURE PROFILE_BASIC_ALPHAAMYLASE_TEMPERATURE +#define PROFILE_TRIGO_MASHOUT_TEMPERATURE 78 +#define PROFILE_TRIGO_RECIRCULATION_TEMPERATURE PROFILE_BASIC_RECIRCULATION_TEMPERATURE +#define PROFILE_TRIGO_SPARGE_TEMPERATURE PROFILE_BASIC_SPARGE_TEMPERATURE +#define PROFILE_TRIGO_BOIL_TEMPERATURE PROFILE_BASIC_BOIL_TEMPERATURE +#define PROFILE_TRIGO_COOLING_TEMPERATURE PROFILE_BASIC_COOLING_TEMPERATURE + +//#define PROFILE_TRIGO_WHEAT_MULTIPLIER 0.05 +//#define PROFILE_TRIGO_PILSNER_MULTIPLIER 0.2 +//#define PROFILE_TRIGO_MAGNUM_MULTIPLIER 0.05 +//#define PROFILE_TRIGO_STYRIAN_GOLDINGS_MULTIPLIER 0.8 +#define PROFILE_TRIGO_WHEAT_MULTIPLIER 0.1 +#define PROFILE_TRIGO_PILSNER_MULTIPLIER 0.1 +#define PROFILE_TRIGO_HERKULES_MULTIPLIER 0.2 +#define PROFILE_TRIGO_TRADITION_MULTIPLIER 0.8 +#define PROFILE_TRIGO_SPARGE_WATER_MULTIPLIER 0.6635 +#define PROFILE_TRIGO_MASH_THICKNESS 3.12952667 // IPA -#define PROFILE_IPA_STARTPOINT_TIME PROFILE_BASIC_STARTPOINT_TIME; -#define PROFILE_IPA_BETAGLUCANASE_TIME PROFILE_BASIC_BETAGLUCANASE_TIME; -#define PROFILE_IPA_DEBRANCHING_TIME PROFILE_BASIC_DEBRANCHING_TIME; -#define PROFILE_IPA_PROTEOLYTIC_TIME PROFILE_BASIC_PROTEOLYTIC_TIME; -#define PROFILE_IPA_BETAAMYLASE_TIME PROFILE_BASIC_BETAAMYLASE_TIME; -#define PROFILE_IPA_ALPHAAMYLASE_TIME PROFILE_BASIC_ALPHAAMYLASE_TIME; -#define PROFILE_IPA_MASHOUT_TIME PROFILE_BASIC_MASHOUT_TIME; -#define PROFILE_IPA_RECIRCULATION_TIME PROFILE_BASIC_RECIRCULATION_TIME; -#define PROFILE_IPA_SPARGE_TIME PROFILE_BASIC_SPARGE_TIME; -#define PROFILE_IPA_BOIL_TIME 3900; -#define PROFILE_IPA_COOLING_TIME PROFILE_BASIC_COOLING_TIME; - -#define PROFILE_IPA_STARTPOINT_TEMPERATURE PROFILE_TRIGO_STARTPOINT_TEMPERATURE; -#define PROFILE_IPA_BETAGLUCANASE_TEMPERATURE PROFILE_BASIC_BETAGLUCANASE_TEMPERATURE; -#define PROFILE_IPA_DEBRANCHING_TEMPERATURE PROFILE_BASIC_DEBRANCHING_TEMPERATURE; -#define PROFILE_IPA_PROTEOLYTIC_TEMPERATURE PROFILE_BASIC_PROTEOLYTIC_TEMPERATURE; -#define PROFILE_IPA_BETAAMYLASE_TEMPERATURE PROFILE_TRIGO_BETAAMYLASE_TEMPERATURE; -#define PROFILE_IPA_ALPHAAMYLASE_TEMPERATURE PROFILE_BASIC_ALPHAAMYLASE_TEMPERATURE; -#define PROFILE_IPA_MASHOUT_TEMPERATURE PROFILE_TRIGO_MASHOUT_TEMPERATURE; -#define PROFILE_IPA_RECIRCULATION_TEMPERATURE PROFILE_BASIC_RECIRCULATION_TEMPERATURE; -#define PROFILE_IPA_SPARGE_TEMPERATURE PROFILE_BASIC_SPARGE_TEMPERATURE; -#define PROFILE_IPA_BOIL_TEMPERATURE PROFILE_BASIC_BOIL_TEMPERATURE; -#define PROFILE_IPA_COOLING_TEMPERATURE PROFILE_BASIC_COOLING_TEMPERATURE; +#define PROFILE_IPA_STARTPOINT_TIME PROFILE_BASIC_STARTPOINT_TIME +#define PROFILE_IPA_BETAGLUCANASE_TIME PROFILE_BASIC_BETAGLUCANASE_TIME +#define PROFILE_IPA_DEBRANCHING_TIME PROFILE_BASIC_DEBRANCHING_TIME +#define PROFILE_IPA_PROTEOLYTIC_TIME PROFILE_BASIC_PROTEOLYTIC_TIME +#define PROFILE_IPA_BETAAMYLASE_TIME PROFILE_BASIC_BETAAMYLASE_TIME +#define PROFILE_IPA_ALPHAAMYLASE_TIME PROFILE_BASIC_ALPHAAMYLASE_TIME +#define PROFILE_IPA_MASHOUT_TIME PROFILE_BASIC_MASHOUT_TIME +#define PROFILE_IPA_RECIRCULATION_TIME PROFILE_BASIC_RECIRCULATION_TIME +#define PROFILE_IPA_SPARGE_TIME PROFILE_BASIC_SPARGE_TIME +#define PROFILE_IPA_BOIL_TIME 3900 +#define PROFILE_IPA_COOLING_TIME PROFILE_BASIC_COOLING_TIME + +#define PROFILE_IPA_STARTPOINT_TEMPERATURE PROFILE_TRIGO_STARTPOINT_TEMPERATURE +#define PROFILE_IPA_BETAGLUCANASE_TEMPERATURE PROFILE_BASIC_BETAGLUCANASE_TEMPERATURE +#define PROFILE_IPA_DEBRANCHING_TEMPERATURE PROFILE_BASIC_DEBRANCHING_TEMPERATURE +#define PROFILE_IPA_PROTEOLYTIC_TEMPERATURE PROFILE_BASIC_PROTEOLYTIC_TEMPERATURE +#define PROFILE_IPA_BETAAMYLASE_TEMPERATURE PROFILE_TRIGO_BETAAMYLASE_TEMPERATURE +#define PROFILE_IPA_ALPHAAMYLASE_TEMPERATURE PROFILE_BASIC_ALPHAAMYLASE_TEMPERATURE +#define PROFILE_IPA_MASHOUT_TEMPERATURE PROFILE_TRIGO_MASHOUT_TEMPERATURE +#define PROFILE_IPA_RECIRCULATION_TEMPERATURE PROFILE_BASIC_RECIRCULATION_TEMPERATURE +#define PROFILE_IPA_SPARGE_TEMPERATURE PROFILE_BASIC_SPARGE_TEMPERATURE +#define PROFILE_IPA_BOIL_TEMPERATURE PROFILE_BASIC_BOIL_TEMPERATURE +#define PROFILE_IPA_COOLING_TEMPERATURE PROFILE_BASIC_COOLING_TEMPERATURE + +#define PROFILE_IPA_CARAMEL_MULTIPLIER 0.013157895 +#define PROFILE_IPA_WHEAT_MULTIPLIER 0.060526316 +#define PROFILE_IPA_PILSNER_MULTIPLIER 0.115789474 +#define PROFILE_IPA_MUNICH_MULTIPLIER 0.028947368 // BELGA -#define PROFILE_BELGA_STARTPOINT_TIME PROFILE_BASIC_STARTPOINT_TIME; -#define PROFILE_BELGA_BETAGLUCANASE_TIME PROFILE_BASIC_BETAGLUCANASE_TIME; -#define PROFILE_BELGA_DEBRANCHING_TIME PROFILE_BASIC_DEBRANCHING_TIME; -#define PROFILE_BELGA_PROTEOLYTIC_TIME PROFILE_BASIC_PROTEOLYTIC_TIME; -#define PROFILE_BELGA_BETAAMYLASE_TIME PROFILE_BASIC_BETAAMYLASE_TIME; -#define PROFILE_BELGA_ALPHAAMYLASE_TIME PROFILE_BASIC_ALPHAAMYLASE_TIME; -#define PROFILE_BELGA_MASHOUT_TIME PROFILE_BASIC_MASHOUT_TIME; -#define PROFILE_BELGA_RECIRCULATION_TIME PROFILE_BASIC_RECIRCULATION_TIME; -#define PROFILE_BELGA_SPARGE_TIME PROFILE_BASIC_SPARGE_TIME; -#define PROFILE_BELGA_BOIL_TIME PROFILE_BASIC_BOIL_TIME; -#define PROFILE_BELGA_COOLING_TIME PROFILE_BASIC_COOLING_TIME; - -#define PROFILE_BELGA_STARTPOINT_TEMPERATURE PROFILE_TRIGO_STARTPOINT_TEMPERATURE; -#define PROFILE_BELGA_BETAGLUCANASE_TEMPERATURE PROFILE_BASIC_BETAGLUCANASE_TEMPERATURE; -#define PROFILE_BELGA_DEBRANCHING_TEMPERATURE PROFILE_BASIC_DEBRANCHING_TEMPERATURE; -#define PROFILE_BELGA_PROTEOLYTIC_TEMPERATURE PROFILE_BASIC_PROTEOLYTIC_TEMPERATURE; -#define PROFILE_BELGA_BETAAMYLASE_TEMPERATURE PROFILE_TRIGO_BETAAMYLASE_TEMPERATURE; -#define PROFILE_BELGA_ALPHAAMYLASE_TEMPERATURE PROFILE_BASIC_ALPHAAMYLASE_TEMPERATURE; -#define PROFILE_BELGA_MASHOUT_TEMPERATURE PROFILE_TRIGO_MASHOUT_TEMPERATURE; -#define PROFILE_BELGA_RECIRCULATION_TEMPERATURE PROFILE_BASIC_RECIRCULATION_TEMPERATURE; -#define PROFILE_BELGA_SPARGE_TEMPERATURE PROFILE_BASIC_SPARGE_TEMPERATURE; -#define PROFILE_BELGA_BOIL_TEMPERATURE PROFILE_BASIC_BOIL_TEMPERATURE; -#define PROFILE_BELGA_COOLING_TEMPERATURE PROFILE_BASIC_COOLING_TEMPERATURE; +#define PROFILE_BELGA_STARTPOINT_TIME PROFILE_BASIC_STARTPOINT_TIME +#define PROFILE_BELGA_BETAGLUCANASE_TIME PROFILE_BASIC_BETAGLUCANASE_TIME +#define PROFILE_BELGA_DEBRANCHING_TIME PROFILE_BASIC_DEBRANCHING_TIME +#define PROFILE_BELGA_PROTEOLYTIC_TIME PROFILE_BASIC_PROTEOLYTIC_TIME +#define PROFILE_BELGA_BETAAMYLASE_TIME PROFILE_BASIC_BETAAMYLASE_TIME +#define PROFILE_BELGA_ALPHAAMYLASE_TIME PROFILE_BASIC_ALPHAAMYLASE_TIME +#define PROFILE_BELGA_MASHOUT_TIME PROFILE_BASIC_MASHOUT_TIME +#define PROFILE_BELGA_RECIRCULATION_TIME PROFILE_BASIC_RECIRCULATION_TIME +#define PROFILE_BELGA_SPARGE_TIME PROFILE_BASIC_SPARGE_TIME +#define PROFILE_BELGA_BOIL_TIME PROFILE_BASIC_BOIL_TIME +#define PROFILE_BELGA_COOLING_TIME PROFILE_BASIC_COOLING_TIME + +#define PROFILE_BELGA_STARTPOINT_TEMPERATURE PROFILE_TRIGO_STARTPOINT_TEMPERATURE +#define PROFILE_BELGA_BETAGLUCANASE_TEMPERATURE PROFILE_BASIC_BETAGLUCANASE_TEMPERATURE +#define PROFILE_BELGA_DEBRANCHING_TEMPERATURE PROFILE_BASIC_DEBRANCHING_TEMPERATURE +#define PROFILE_BELGA_PROTEOLYTIC_TEMPERATURE PROFILE_BASIC_PROTEOLYTIC_TEMPERATURE +#define PROFILE_BELGA_BETAAMYLASE_TEMPERATURE PROFILE_TRIGO_BETAAMYLASE_TEMPERATURE +#define PROFILE_BELGA_ALPHAAMYLASE_TEMPERATURE PROFILE_BASIC_ALPHAAMYLASE_TEMPERATURE +#define PROFILE_BELGA_MASHOUT_TEMPERATURE PROFILE_TRIGO_MASHOUT_TEMPERATURE +#define PROFILE_BELGA_RECIRCULATION_TEMPERATURE PROFILE_BASIC_RECIRCULATION_TEMPERATURE +#define PROFILE_BELGA_SPARGE_TEMPERATURE PROFILE_BASIC_SPARGE_TEMPERATURE +#define PROFILE_BELGA_BOIL_TEMPERATURE PROFILE_BASIC_BOIL_TEMPERATURE +#define PROFILE_BELGA_COOLING_TEMPERATURE PROFILE_BASIC_COOLING_TEMPERATURE // RED -#define PROFILE_RED_STARTPOINT_TIME PROFILE_BASIC_STARTPOINT_TIME; -#define PROFILE_RED_BETAGLUCANASE_TIME PROFILE_BASIC_BETAGLUCANASE_TIME; -#define PROFILE_RED_DEBRANCHING_TIME PROFILE_BASIC_DEBRANCHING_TIME; -#define PROFILE_RED_PROTEOLYTIC_TIME PROFILE_BASIC_PROTEOLYTIC_TIME; -#define PROFILE_RED_BETAAMYLASE_TIME PROFILE_BASIC_BETAAMYLASE_TIME; -#define PROFILE_RED_ALPHAAMYLASE_TIME PROFILE_BASIC_ALPHAAMYLASE_TIME; -#define PROFILE_RED_MASHOUT_TIME PROFILE_BASIC_MASHOUT_TIME; -#define PROFILE_RED_RECIRCULATION_TIME PROFILE_BASIC_RECIRCULATION_TIME; -#define PROFILE_RED_SPARGE_TIME PROFILE_BASIC_SPARGE_TIME; -#define PROFILE_RED_BOIL_TIME PROFILE_BASIC_BOIL_TIME; -#define PROFILE_RED_COOLING_TIME PROFILE_BASIC_COOLING_TIME; - -#define PROFILE_RED_STARTPOINT_TEMPERATURE PROFILE_TRIGO_STARTPOINT_TEMPERATURE; -#define PROFILE_RED_BETAGLUCANASE_TEMPERATURE PROFILE_BASIC_BETAGLUCANASE_TEMPERATURE; -#define PROFILE_RED_DEBRANCHING_TEMPERATURE PROFILE_BASIC_DEBRANCHING_TEMPERATURE; -#define PROFILE_RED_PROTEOLYTIC_TEMPERATURE PROFILE_BASIC_PROTEOLYTIC_TEMPERATURE; -#define PROFILE_RED_BETAAMYLASE_TEMPERATURE PROFILE_TRIGO_BETAAMYLASE_TEMPERATURE; -#define PROFILE_RED_ALPHAAMYLASE_TEMPERATURE PROFILE_BASIC_ALPHAAMYLASE_TEMPERATURE; -#define PROFILE_RED_MASHOUT_TEMPERATURE PROFILE_TRIGO_MASHOUT_TEMPERATURE; -#define PROFILE_RED_RECIRCULATION_TEMPERATURE PROFILE_BASIC_RECIRCULATION_TEMPERATURE; -#define PROFILE_RED_SPARGE_TEMPERATURE PROFILE_BASIC_SPARGE_TEMPERATURE; -#define PROFILE_RED_BOIL_TEMPERATURE PROFILE_BASIC_BOIL_TEMPERATURE; -#define PROFILE_RED_COOLING_TEMPERATURE PROFILE_BASIC_COOLING_TEMPERATURE; +#define PROFILE_RED_STARTPOINT_TIME PROFILE_BASIC_STARTPOINT_TIME +#define PROFILE_RED_BETAGLUCANASE_TIME PROFILE_BASIC_BETAGLUCANASE_TIME +#define PROFILE_RED_DEBRANCHING_TIME PROFILE_BASIC_DEBRANCHING_TIME +#define PROFILE_RED_PROTEOLYTIC_TIME PROFILE_BASIC_PROTEOLYTIC_TIME +#define PROFILE_RED_BETAAMYLASE_TIME PROFILE_BASIC_BETAAMYLASE_TIME +#define PROFILE_RED_ALPHAAMYLASE_TIME PROFILE_BASIC_ALPHAAMYLASE_TIME +#define PROFILE_RED_MASHOUT_TIME PROFILE_BASIC_MASHOUT_TIME +#define PROFILE_RED_RECIRCULATION_TIME PROFILE_BASIC_RECIRCULATION_TIME +#define PROFILE_RED_SPARGE_TIME PROFILE_BASIC_SPARGE_TIME +#define PROFILE_RED_BOIL_TIME PROFILE_BASIC_BOIL_TIME +#define PROFILE_RED_COOLING_TIME PROFILE_BASIC_COOLING_TIME + +#define PROFILE_RED_STARTPOINT_TEMPERATURE PROFILE_TRIGO_STARTPOINT_TEMPERATURE +#define PROFILE_RED_BETAGLUCANASE_TEMPERATURE PROFILE_BASIC_BETAGLUCANASE_TEMPERATURE +#define PROFILE_RED_DEBRANCHING_TEMPERATURE PROFILE_BASIC_DEBRANCHING_TEMPERATURE +#define PROFILE_RED_PROTEOLYTIC_TEMPERATURE PROFILE_BASIC_PROTEOLYTIC_TEMPERATURE +#define PROFILE_RED_BETAAMYLASE_TEMPERATURE PROFILE_TRIGO_BETAAMYLASE_TEMPERATURE +#define PROFILE_RED_ALPHAAMYLASE_TEMPERATURE PROFILE_BASIC_ALPHAAMYLASE_TEMPERATURE +#define PROFILE_RED_MASHOUT_TEMPERATURE PROFILE_TRIGO_MASHOUT_TEMPERATURE +#define PROFILE_RED_RECIRCULATION_TEMPERATURE PROFILE_BASIC_RECIRCULATION_TEMPERATURE +#define PROFILE_RED_SPARGE_TEMPERATURE PROFILE_BASIC_SPARGE_TEMPERATURE +#define PROFILE_RED_BOIL_TEMPERATURE PROFILE_BASIC_BOIL_TEMPERATURE +#define PROFILE_RED_COOLING_TEMPERATURE PROFILE_BASIC_COOLING_TEMPERATURE // APA -#define PROFILE_APA_STARTPOINT_TIME PROFILE_BASIC_STARTPOINT_TIME; -#define PROFILE_APA_BETAGLUCANASE_TIME PROFILE_BASIC_BETAGLUCANASE_TIME; -#define PROFILE_APA_DEBRANCHING_TIME PROFILE_BASIC_DEBRANCHING_TIME; -#define PROFILE_APA_PROTEOLYTIC_TIME PROFILE_BASIC_PROTEOLYTIC_TIME; -#define PROFILE_APA_BETAAMYLASE_TIME PROFILE_BASIC_BETAAMYLASE_TIME; -#define PROFILE_APA_ALPHAAMYLASE_TIME PROFILE_BASIC_ALPHAAMYLASE_TIME; -#define PROFILE_APA_MASHOUT_TIME PROFILE_BASIC_MASHOUT_TIME; -#define PROFILE_APA_RECIRCULATION_TIME PROFILE_BASIC_RECIRCULATION_TIME; -#define PROFILE_APA_SPARGE_TIME PROFILE_BASIC_SPARGE_TIME; -#define PROFILE_APA_BOIL_TIME PROFILE_BASIC_BOIL_TIME; -#define PROFILE_APA_COOLING_TIME PROFILE_BASIC_COOLING_TIME; - -#define PROFILE_APA_STARTPOINT_TEMPERATURE PROFILE_TRIGO_STARTPOINT_TEMPERATURE; -#define PROFILE_APA_BETAGLUCANASE_TEMPERATURE PROFILE_BASIC_BETAGLUCANASE_TEMPERATURE; -#define PROFILE_APA_DEBRANCHING_TEMPERATURE PROFILE_BASIC_DEBRANCHING_TEMPERATURE; -#define PROFILE_APA_PROTEOLYTIC_TEMPERATURE PROFILE_BASIC_PROTEOLYTIC_TEMPERATURE; -#define PROFILE_APA_BETAAMYLASE_TEMPERATURE PROFILE_TRIGO_BETAAMYLASE_TEMPERATURE; -#define PROFILE_APA_ALPHAAMYLASE_TEMPERATURE PROFILE_BASIC_ALPHAAMYLASE_TEMPERATURE; -#define PROFILE_APA_MASHOUT_TEMPERATURE PROFILE_TRIGO_MASHOUT_TEMPERATURE; -#define PROFILE_APA_RECIRCULATION_TEMPERATURE PROFILE_BASIC_RECIRCULATION_TEMPERATURE; -#define PROFILE_APA_SPARGE_TEMPERATURE PROFILE_BASIC_SPARGE_TEMPERATURE; -#define PROFILE_APA_BOIL_TEMPERATURE PROFILE_BASIC_BOIL_TEMPERATURE; -#define PROFILE_APA_COOLING_TEMPERATURE PROFILE_BASIC_COOLING_TEMPERATURE; +#define PROFILE_APA_STARTPOINT_TIME PROFILE_BASIC_STARTPOINT_TIME +#define PROFILE_APA_BETAGLUCANASE_TIME PROFILE_BASIC_BETAGLUCANASE_TIME +#define PROFILE_APA_DEBRANCHING_TIME PROFILE_BASIC_DEBRANCHING_TIME +#define PROFILE_APA_PROTEOLYTIC_TIME PROFILE_BASIC_PROTEOLYTIC_TIME +#define PROFILE_APA_BETAAMYLASE_TIME PROFILE_BASIC_BETAAMYLASE_TIME +#define PROFILE_APA_ALPHAAMYLASE_TIME PROFILE_BASIC_ALPHAAMYLASE_TIME +#define PROFILE_APA_MASHOUT_TIME PROFILE_BASIC_MASHOUT_TIME +#define PROFILE_APA_RECIRCULATION_TIME PROFILE_BASIC_RECIRCULATION_TIME +#define PROFILE_APA_SPARGE_TIME PROFILE_BASIC_SPARGE_TIME +#define PROFILE_APA_BOIL_TIME PROFILE_BASIC_BOIL_TIME +#define PROFILE_APA_COOLING_TIME PROFILE_BASIC_COOLING_TIME + +#define PROFILE_APA_STARTPOINT_TEMPERATURE PROFILE_TRIGO_STARTPOINT_TEMPERATURE +#define PROFILE_APA_BETAGLUCANASE_TEMPERATURE PROFILE_BASIC_BETAGLUCANASE_TEMPERATURE +#define PROFILE_APA_DEBRANCHING_TEMPERATURE PROFILE_BASIC_DEBRANCHING_TEMPERATURE +#define PROFILE_APA_PROTEOLYTIC_TEMPERATURE PROFILE_BASIC_PROTEOLYTIC_TEMPERATURE +#define PROFILE_APA_BETAAMYLASE_TEMPERATURE PROFILE_TRIGO_BETAAMYLASE_TEMPERATURE +#define PROFILE_APA_ALPHAAMYLASE_TEMPERATURE PROFILE_BASIC_ALPHAAMYLASE_TEMPERATURE +#define PROFILE_APA_MASHOUT_TEMPERATURE PROFILE_TRIGO_MASHOUT_TEMPERATURE +#define PROFILE_APA_RECIRCULATION_TEMPERATURE PROFILE_BASIC_RECIRCULATION_TEMPERATURE +#define PROFILE_APA_SPARGE_TEMPERATURE PROFILE_BASIC_SPARGE_TEMPERATURE +#define PROFILE_APA_BOIL_TEMPERATURE PROFILE_BASIC_BOIL_TEMPERATURE +#define PROFILE_APA_COOLING_TEMPERATURE PROFILE_BASIC_COOLING_TEMPERATURE // CUSTOM -#define PROFILE_CUSTOM_STARTPOINT_TIME PROFILE_BASIC_STARTPOINT_TIME; -#define PROFILE_CUSTOM_BETAGLUCANASE_TIME PROFILE_BASIC_STARTPOINT_TIME; -#define PROFILE_CUSTOM_DEBRANCHING_TIME PROFILE_BASIC_STARTPOINT_TIME; -#define PROFILE_CUSTOM_PROTEOLYTIC_TIME PROFILE_BASIC_STARTPOINT_TIME; -#define PROFILE_CUSTOM_BETAAMYLASE_TIME PROFILE_BASIC_STARTPOINT_TIME; -#define PROFILE_CUSTOM_ALPHAAMYLASE_TIME PROFILE_BASIC_STARTPOINT_TIME; -#define PROFILE_CUSTOM_MASHOUT_TIME PROFILE_BASIC_STARTPOINT_TIME; -#define PROFILE_CUSTOM_RECIRCULATION_TIME PROFILE_BASIC_STARTPOINT_TIME; -#define PROFILE_CUSTOM_SPARGE_TIME PROFILE_BASIC_STARTPOINT_TIME; -#define PROFILE_CUSTOM_BOIL_TIME PROFILE_BASIC_STARTPOINT_TIME; -#define PROFILE_CUSTOM_COOLING_TIME PROFILE_BASIC_STARTPOINT_TIME; - -#define PROFILE_CUSTOM_STARTPOINT_TEMPERATURE 30; -#define PROFILE_CUSTOM_BETAGLUCANASE_TEMPERATURE 45; -#define PROFILE_CUSTOM_DEBRANCHING_TEMPERATURE 50; -#define PROFILE_CUSTOM_PROTEOLYTIC_TEMPERATURE 55; -#define PROFILE_CUSTOM_BETAAMYLASE_TEMPERATURE 65; -#define PROFILE_CUSTOM_ALPHAAMYLASE_TEMPERATURE 75; -#define PROFILE_CUSTOM_MASHOUT_TEMPERATURE 70; -#define PROFILE_CUSTOM_RECIRCULATION_TEMPERATURE 85; -#define PROFILE_CUSTOM_SPARGE_TEMPERATURE 90; -#define PROFILE_CUSTOM_BOIL_TEMPERATURE 95; -#define PROFILE_CUSTOM_COOLING_TEMPERATURE 100; +#define PROFILE_CUSTOM_STARTPOINT_TIME PROFILE_BASIC_STARTPOINT_TIME +#define PROFILE_CUSTOM_BETAGLUCANASE_TIME PROFILE_BASIC_STARTPOINT_TIME +#define PROFILE_CUSTOM_DEBRANCHING_TIME PROFILE_BASIC_STARTPOINT_TIME +#define PROFILE_CUSTOM_PROTEOLYTIC_TIME PROFILE_BASIC_STARTPOINT_TIME +#define PROFILE_CUSTOM_BETAAMYLASE_TIME PROFILE_BASIC_STARTPOINT_TIME +#define PROFILE_CUSTOM_ALPHAAMYLASE_TIME PROFILE_BASIC_STARTPOINT_TIME +#define PROFILE_CUSTOM_MASHOUT_TIME PROFILE_BASIC_STARTPOINT_TIME +#define PROFILE_CUSTOM_RECIRCULATION_TIME PROFILE_BASIC_STARTPOINT_TIME +#define PROFILE_CUSTOM_SPARGE_TIME PROFILE_BASIC_STARTPOINT_TIME +#define PROFILE_CUSTOM_BOIL_TIME PROFILE_BASIC_STARTPOINT_TIME +#define PROFILE_CUSTOM_COOLING_TIME PROFILE_BASIC_STARTPOINT_TIME + +#define PROFILE_CUSTOM_STARTPOINT_TEMPERATURE 30 +#define PROFILE_CUSTOM_BETAGLUCANASE_TEMPERATURE 45 +#define PROFILE_CUSTOM_DEBRANCHING_TEMPERATURE 50 +#define PROFILE_CUSTOM_PROTEOLYTIC_TEMPERATURE 55 +#define PROFILE_CUSTOM_BETAAMYLASE_TEMPERATURE 65 +#define PROFILE_CUSTOM_ALPHAAMYLASE_TEMPERATURE 75 +#define PROFILE_CUSTOM_MASHOUT_TEMPERATURE 70 +#define PROFILE_CUSTOM_RECIRCULATION_TEMPERATURE 85 +#define PROFILE_CUSTOM_SPARGE_TEMPERATURE 90 +#define PROFILE_CUSTOM_BOIL_TEMPERATURE 95 +#define PROFILE_CUSTOM_COOLING_TEMPERATURE 100 #endif //__PROFILES diff --git a/brew.h b/brew.h index 692db34..300839c 100644 --- a/brew.h +++ b/brew.h @@ -113,4 +113,8 @@ unsigned long getInactivityTime(); void xWaitForAction(String title, String message); +void printBeerProfile( void ); +void printTime( unsigned long timeToPrint ); +void printTemperature( int temparatureToPrint ); + #endif //__BREW diff --git a/brew.ino b/brew.ino index b1a1866..35e5238 100644 --- a/brew.ino +++ b/brew.ino @@ -310,30 +310,30 @@ void setup() { cookTemperature = 25; finalYield = SETTING_MACHINE_YIELD_DEFAULT; - startpointTime = PROFILE_BASIC_STARTPOINT_TIME; - betaGlucanaseTime = PROFILE_BASIC_BETAGLUCANASE_TIME; - debranchingTime = PROFILE_BASIC_DEBRANCHING_TIME; - proteolyticTime = PROFILE_BASIC_PROTEOLYTIC_TIME; - betaAmylaseTime = PROFILE_BASIC_BETAAMYLASE_TIME; - alphaAmylaseTime = PROFILE_BASIC_ALPHAAMYLASE_TIME; - mashoutTime = PROFILE_BASIC_MASHOUT_TIME; - recirculationTime = PROFILE_BASIC_RECIRCULATION_TIME; - spargeTime = PROFILE_BASIC_SPARGE_TIME; - boilTime = PROFILE_BASIC_BOIL_TIME; - coolingTime = PROFILE_BASIC_COOLING_TIME; + startpointTime = PROFILE_TRIGO_STARTPOINT_TIME; + betaGlucanaseTime = PROFILE_TRIGO_BETAGLUCANASE_TIME; + debranchingTime = PROFILE_TRIGO_DEBRANCHING_TIME; + proteolyticTime = PROFILE_TRIGO_PROTEOLYTIC_TIME; + betaAmylaseTime = PROFILE_TRIGO_BETAAMYLASE_TIME; + alphaAmylaseTime = PROFILE_TRIGO_ALPHAAMYLASE_TIME; + mashoutTime = PROFILE_TRIGO_MASHOUT_TIME; + recirculationTime = PROFILE_TRIGO_RECIRCULATION_TIME; + spargeTime = PROFILE_TRIGO_SPARGE_TIME; + boilTime = PROFILE_TRIGO_BOIL_TIME; + coolingTime = PROFILE_TRIGO_COOLING_TIME; cleaningTime = SETTING_CLEANING_TIME; - startpointTemperature = PROFILE_BASIC_STARTPOINT_TEMPERATURE; - betaGlucanaseTemperature = PROFILE_BASIC_BETAGLUCANASE_TEMPERATURE; - debranchingTemperature = PROFILE_BASIC_DEBRANCHING_TEMPERATURE; - proteolyticTemperature = PROFILE_BASIC_PROTEOLYTIC_TEMPERATURE; - betaAmylaseTemperature = PROFILE_BASIC_BETAAMYLASE_TEMPERATURE; - alphaAmylaseTemperature = PROFILE_BASIC_ALPHAAMYLASE_TEMPERATURE; - mashoutTemperature = PROFILE_BASIC_MASHOUT_TEMPERATURE; - recirculationTemperature = PROFILE_BASIC_RECIRCULATION_TEMPERATURE; - spargeTemperature = PROFILE_BASIC_SPARGE_TEMPERATURE; - boilTemperature = PROFILE_BASIC_BOIL_TEMPERATURE; - coolingTemperature = PROFILE_BASIC_COOLING_TEMPERATURE; + startpointTemperature = PROFILE_TRIGO_STARTPOINT_TEMPERATURE; + betaGlucanaseTemperature = PROFILE_TRIGO_BETAGLUCANASE_TEMPERATURE; + debranchingTemperature = PROFILE_TRIGO_DEBRANCHING_TEMPERATURE; + proteolyticTemperature = PROFILE_TRIGO_PROTEOLYTIC_TEMPERATURE; + betaAmylaseTemperature = PROFILE_TRIGO_BETAAMYLASE_TEMPERATURE; + alphaAmylaseTemperature = PROFILE_TRIGO_ALPHAAMYLASE_TEMPERATURE; + mashoutTemperature = PROFILE_TRIGO_MASHOUT_TEMPERATURE; + recirculationTemperature = PROFILE_TRIGO_RECIRCULATION_TEMPERATURE; + spargeTemperature = PROFILE_TRIGO_SPARGE_TEMPERATURE; + boilTemperature = PROFILE_TRIGO_BOIL_TEMPERATURE; + coolingTemperature = PROFILE_TRIGO_COOLING_TEMPERATURE; cleaningTemperature = SETTING_CLEANING_TEMPERATURE; refresh = true; @@ -352,6 +352,8 @@ void setup() { xWelcomeUser (); xSetupRotaryEncoder ( eRotaryEncoderMode_Menu, eMainMenu_GO, MENU_SIZE_MAIN_MENU - 1, 1, 1, 0 ); + + printBeerProfile(); } // ######################### MAIN LOOP ######################### @@ -394,13 +396,15 @@ void xCountTheTime( int temperatureMarginRange, boolean bMaximumOfUpDown ) { } // Ignote time ticks if temperature is not within the acceptable margin for this stage - unsigned long elapsedTime = now - clockLastUpdate; + unsigned long lastWindowTime = now - clockLastUpdate; if ( temperatureCount < (cookTemperature - temperatureMarginRange) ) { - clockIgnore += elapsedTime; + clockIgnore += lastWindowTime; } // Calculate the remaining time on the clock - clockCounter = cookTime * 1000 - (elapsedTime - clockIgnore); + //clockCounter = cookTime * 1000 - (lastWindowTime - clockIgnore); + unsigned long elepsedTime = now - clockStartTime; + clockCounter = cookTime * 1000 - (elepsedTime - clockIgnore); // Don't let clock get bellow 0 if ( clockCounter < 0 ) { @@ -531,6 +535,7 @@ bool xRegulateTemperature( boolean bMaximumOfUpDown ) { } void xPurgePump() { + lcdPrint(&lcd, " Purging", " Pump!"); // Write welcome for (int i = 0; i < 2; i++) { analogWrite(PUMP_PIN, PUMP_SPEED_MAX_MOSFET); // analogWrite values from 0 to 255 delay(1000); @@ -837,6 +842,40 @@ void xManageMachineSystems() { upPT100.measure(false); downPT100.measure(true); +#ifdef INFO + unsigned long now = millis(); + if( now - loggingTimeInterval > SETTING_MACHINE_LOGGING_INTERVAL ) { + loggingTimeInterval = now; + Serial.print("|"); + Serial.print(now); + Serial.print("|"); + Serial.print(clockCounter); + Serial.print("|"); + if (cooking) { + Serial.print("1"); + } + else { + Serial.print("0"); + } + Serial.print("|"); + Serial.print(cookTemperature); + Serial.print("|"); + Serial.print(basePT100.getCurrentTemperature()); + Serial.print("|"); + Serial.print(upPT100.getCurrentTemperature()); + Serial.print("|"); + Serial.print(downPT100.getCurrentTemperature()); + Serial.print("|"); + if (bStatusElement) { + Serial.print("1"); + } + else { + Serial.print("0"); + } + Serial.println("|"); + } +#endif + // If cooking is done, return (this is a nice place to double check safety and ensure the cooking parts aren't on. if (!cooking) { xSafeHardwarePowerOff(); @@ -906,41 +945,6 @@ void xManageMachineSystems() { break; } } - -#ifdef INFO - unsigned long now = millis(); - if( now - loggingTimeInterval > SETTING_MACHINE_LOGGING_INTERVAL ) { - loggingTimeInterval = now; - Serial.print(now); - Serial.print("|"); - Serial.print(clockCounter); - Serial.print("|"); - if (cooking) { - Serial.print("1"); - } - else { - Serial.print("0"); - } - Serial.print("|"); - Serial.print(cookTemperature); - Serial.print("|"); - Serial.print(basePT100.getCurrentTemperature()); - Serial.print("|"); - Serial.print(upPT100.getCurrentTemperature()); - Serial.print("|"); - Serial.print(downPT100.getCurrentTemperature()); - Serial.print("|"); - if (bStatusElement) { - Serial.print("1"); - } - else { - Serial.print("0"); - } - Serial.print("|"); - } - - -#endif } // ##################################################### Menus ################################################################### @@ -1145,6 +1149,7 @@ void runBeerProfileSelection() { boilTemperature = PROFILE_BASIC_BOIL_TEMPERATURE; coolingTemperature = PROFILE_BASIC_COOLING_TEMPERATURE; + printBeerProfile(); backToStatus(); break; } @@ -1173,6 +1178,7 @@ void runBeerProfileSelection() { boilTemperature = PROFILE_TRIGO_BOIL_TEMPERATURE; coolingTemperature = PROFILE_TRIGO_COOLING_TEMPERATURE; + printBeerProfile(); backToStatus(); break; } @@ -1201,6 +1207,7 @@ void runBeerProfileSelection() { boilTemperature = PROFILE_IPA_BOIL_TEMPERATURE; coolingTemperature = PROFILE_IPA_COOLING_TEMPERATURE; + printBeerProfile(); backToStatus(); break; } @@ -1229,6 +1236,7 @@ void runBeerProfileSelection() { boilTemperature = PROFILE_BELGA_BOIL_TEMPERATURE; coolingTemperature = PROFILE_BELGA_COOLING_TEMPERATURE; + printBeerProfile(); backToStatus(); break; } @@ -1256,7 +1264,8 @@ void runBeerProfileSelection() { spargeTemperature = PROFILE_RED_SPARGE_TEMPERATURE; boilTemperature = PROFILE_RED_BOIL_TEMPERATURE; coolingTemperature = PROFILE_RED_COOLING_TEMPERATURE; - + + printBeerProfile(); backToStatus(); break; } @@ -1285,6 +1294,7 @@ void runBeerProfileSelection() { boilTemperature = PROFILE_APA_BOIL_TEMPERATURE; coolingTemperature = PROFILE_APA_COOLING_TEMPERATURE; + printBeerProfile(); backToStatus(); break; } @@ -1313,6 +1323,7 @@ void runBeerProfileSelection() { boilTemperature = PROFILE_CUSTOM_BOIL_TEMPERATURE; coolingTemperature = PROFILE_CUSTOM_COOLING_TEMPERATURE; + printBeerProfile(); backToStatus(); break; } @@ -1543,6 +1554,7 @@ void startBrewing() { void stopBrewing() { cooking = false; + xSafeHardwarePowerOff(); } void resetMenu( boolean requestRepaintPaint ) { @@ -1736,17 +1748,186 @@ unsigned long getInactivityTime() { // ###################### Set Variables ################################################## void xWaitForAction(String title, String message) { + unsigned long now = millis(); + unsigned long warningBeepTimeInterval = 0; while (true) { + now = millis(); + if ( checkForEncoderSwitchPush( false ) ) { // Check if pushbutton is pressed break; } else { - sing(BUZZ_1, PIEZO_PIN); - // Print the message if (! lcdPrint(&lcd, title, message)) { break; } + + unsigned long now = millis(); + if( now - warningBeepTimeInterval > SETTING_WARNING_BEEP_INTERVAL ) { + warningBeepTimeInterval = now; + sing(BUZZ_2, PIEZO_PIN); + } + } + } +} + +void printBeerProfile( void ) { + #ifdef INFO + Serial.println("############# Beer Profile #############"); + Serial.print("# beerProfile "); + Serial.print( mdBeerProfileMenu._dialog[beerProfile+1] ); + Serial.println(" #"); + Serial.println("############ Time per Stage ############"); + Serial.print("# startpointTime "); + printTime(startpointTime ); + Serial.println(" #"); + Serial.print("# betaGlucanaseTime "); + printTime(betaGlucanaseTime ); + Serial.println(" #"); + Serial.print("# debranchingTime "); + printTime(debranchingTime ); + Serial.println(" #"); + Serial.print("# proteolyticTime "); + printTime(proteolyticTime ); + Serial.println(" #"); + Serial.print("# betaAmylaseTime "); + printTime(betaAmylaseTime ); + Serial.println(" #"); + Serial.print("# alphaAmylaseTime "); + printTime(alphaAmylaseTime ); + Serial.println(" #"); + Serial.print("# mashoutTime "); + printTime(mashoutTime ); + Serial.println(" #"); + Serial.print("# recirculationTime "); + printTime(recirculationTime ); + Serial.println(" #"); + Serial.print("# spargeTime "); + printTime(spargeTime ); + Serial.println(" #"); + Serial.print("# boilTime "); + printTime(boilTime ); + Serial.println(" #"); + Serial.print("# coolingTime "); + printTime(coolingTime ); + Serial.println(" #"); + Serial.println("######## Teperature per Stage ##########"); + Serial.print("# startpointTemperature "); + printTemperature(startpointTemperature ); + Serial.println(" #"); + Serial.print("# betaGlucanaseTemperature "); + printTemperature(betaGlucanaseTemperature ); + Serial.println(" #"); + Serial.print("# debranchingTemperature "); + printTemperature(debranchingTemperature ); + Serial.println(" #"); + Serial.print("# proteolyticTemperature "); + printTemperature(proteolyticTemperature ); + Serial.println(" #"); + Serial.print("# betaAmylaseTemperature "); + printTemperature(betaAmylaseTemperature ); + Serial.println(" #"); + Serial.print("# alphaAmylaseTemperature "); + printTemperature(alphaAmylaseTemperature ); + Serial.println(" #"); + Serial.print("# mashoutTemperature "); + printTemperature(mashoutTemperature ); + Serial.println(" #"); + Serial.print("# recirculationTemperature "); + printTemperature(recirculationTemperature ); + Serial.println(" #"); + Serial.print("# spargeTemperature "); + printTemperature(spargeTemperature ); + Serial.println(" #"); + Serial.print("# boilTemperature "); + printTemperature(boilTemperature ); + Serial.println(" #"); + Serial.print("# coolingTemperature "); + printTemperature(coolingTemperature ); + Serial.println(" #"); + Serial.println("########################################"); + if( beerProfile == eBeerProfile_Trigo) { + Serial.print("# finalYield "); + if(finalYield < 10) { + Serial.print(" "); + } + Serial.print(finalYield); + Serial.println(" l #"); + float wheatAmount = PROFILE_TRIGO_WHEAT_MULTIPLIER * ((float) finalYield); + Serial.print("# wheatAmount "); + if(wheatAmount < 10) { + Serial.print(" "); } + Serial.print(wheatAmount); + Serial.println(" Kg #"); + float pilsnerAmount = PROFILE_TRIGO_PILSNER_MULTIPLIER * ((float) finalYield); + Serial.print("# pilsnerAmount "); + if(pilsnerAmount < 10) { + Serial.print(" "); + } + Serial.print(pilsnerAmount); + Serial.println(" Kg #"); + float strikeWaterAmount = (pilsnerAmount + wheatAmount) * PROFILE_TRIGO_MASH_THICKNESS; + Serial.print("# strikeWaterAmount "); + if(strikeWaterAmount < 10) { + Serial.print(" "); + } + Serial.print(strikeWaterAmount); + Serial.println(" l #"); + float spargeWaterAmount = PROFILE_TRIGO_SPARGE_WATER_MULTIPLIER * ((float) finalYield); + Serial.print("# spargeWaterAmount "); + if(spargeWaterAmount < 10) { + Serial.print(" "); + } + Serial.print(spargeWaterAmount); + Serial.println(" l #"); + float herkulesAmount = PROFILE_TRIGO_HERKULES_MULTIPLIER * ((float) finalYield); + Serial.print("# herkulesAmount "); + if(herkulesAmount < 10) { + Serial.print(" "); + } + Serial.print(herkulesAmount); + Serial.println(" g #"); + float traditionAmount = PROFILE_TRIGO_TRADITION_MULTIPLIER * ((float) finalYield); + Serial.print("# traditionAmount "); + if(traditionAmount < 10) { + Serial.print(" "); + } + Serial.print(traditionAmount); + Serial.println(" g #"); + Serial.println("########################################"); + } +#endif +} + +void printTime( unsigned long timeToPrint ) { + unsigned long minutes = timeToPrint /60; + unsigned long seconds = timeToPrint %60; + + if (minutes < 100) { + Serial.print(" "); + } + if (minutes < 10) { + Serial.print(" "); + } + Serial.print(minutes); + Serial.print(":"); + if (seconds < 10) { + Serial.print("0"); + } + Serial.print(seconds); +} + +void printTemperature( int temparatureToPrint ) { + if (temparatureToPrint < 100) { + Serial.print(" "); + } + if (temparatureToPrint < 10) { + Serial.print(" "); } + Serial.print(temparatureToPrint); + Serial.print(" "); + Serial.write(176); + Serial.print("C"); } + diff --git a/config.h b/config.h index 9c3c312..b21f5e3 100644 --- a/config.h +++ b/config.h @@ -12,8 +12,9 @@ #define SETTING_CLEANING_TEMPERATURE 45 //45 #define SETTING_MACHINE_YIELD_CAPACITY_MIN 0 #define SETTING_MACHINE_YIELD_CAPACITY_MAX 50 -#define SETTING_MACHINE_YIELD_DEFAULT 25 +#define SETTING_MACHINE_YIELD_DEFAULT 40 #define SETTING_MACHINE_LOGGING_INTERVAL 1000 +#define SETTING_WARNING_BEEP_INTERVAL 5000 // ++++++++++++++++++++++++ Heating Element Relay ++++++++++++++++++++++++ #define HEATING_ELEMENT_DEFAULT_WINDOW_SIZE 1000 @@ -66,7 +67,7 @@ // ++++++++++++++++++++++++ State Machine ++++++++++++++++++++++++ #define SETTING_WELCOME_TIMEOUT 100 #define SETTING_MAX_INACTIVITY_TIME 3000 -#define SETTING_CANCEL_TIMER 2000 +#define SETTING_CANCEL_TIMER 1000 #define MENU_INIT eMenuType_Main #define MENU_SIZE_MAIN_MENU 13 #define MENU_SIZE_PROFILES_MENU 9 @@ -74,7 +75,7 @@ #define MENU_SIZE_MALT_MENU 4 #define MENU_SIZE_SETTINGS_MENU 6 #define SETTING_COOKING_STAGE_INIT eCookingStage_Startpoint -#define SETTING_BEER_PROFILE_INIT eBeerProfile_Basic +#define SETTING_BEER_PROFILE_INIT eBeerProfile_Trigo // ++++++++++++++++++++++++ Menus ++++++++++++++++++++++++ #define MENU_MAIN_TITLE "Brewery Menu" @@ -123,7 +124,8 @@ #define MENU_START_FUNCTION &runStartFromStageSelection // ++++++++++++++++++++++++ Serial Monotor ++++++++++++++++++++++++ -#define SETTING_SERIAL_MONITOR_BAUD_RATE 9600 +#define SETTING_SERIAL_MONITOR_BAUD_RATE 115200 +//#define SETTING_SERIAL_MONITOR_BAUD_RATE 9600 #define SETTING_SERIAL_MONITOR_WELCOME_MESSAGE "Let's start Brewing!" // ######################### LIBRARIES ######################### -- 2.24.1