// https://forum.arduino.cc/t/select-between-groups-of-code-retain-position-in-code-loop-after-power-loss/1437036/33
unsigned long seconds = 1000;
unsigned long minutes = 60000;
int fold = 7; // time in seconds mixer runs to "fold" dough
int mix = 1; // time in minutes mixer runs to "mix" dough
int autolyse = 20; // time in minutes to "autolyse" dough
int rest = 30; // time in minutes to "rest" dough
int pulses = 9; // number of pulses in combine stage
int buzz = 12; // buzzer pin
void setup() // the setup function runs once when you press reset or power the board
{
Serial.begin(115200); // start serial communications with Serial Monitor
pinMode(LED_BUILTIN, OUTPUT); // initialize digital pin LED_BUILTIN (pin D13) as an output for mixer
pinMode(buzz, OUTPUT); // initialize digital pin D12 as an output for buzzer
// 1. Combine MIXING on/off pulse for 1/2 minute (3 seconds of on/offs run 10 times)
Serial.print(" 1. PULSING 1. ");
for (int x = 0; x < 9; x++) // number of pulses (for loop)
{
Serial.print(x + 1);
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1 * seconds); // wait for a set amount of on time
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(2 * seconds); // wait for a set amount of off time
}
Serial.println(". Complete.");
// 2. Gluten Development MIX Part 1 (run for "mix" minutes)
Serial.print(" 2. KNEADING 1.");
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(mix * minutes); // run for a set amount of on time
Serial.println(" Complete.");
// 3. Autolyse for "autolyse" minutes
Serial.print(" 3. PROOFING 1.");
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(autolyse * minutes); // wait for a set amount of off time
Serial.println(" Complete.");
// 4. Gluten Development MIX Part 2a (mix for "mix" minutes) AND Add Salt (BUZZER)
Serial.print(" 4. KNEADING 2.");
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(buzz, HIGH); // turn the BUZZER ON (Pin 12)
delay(mix * minutes); // wait for a set amount of on time
Serial.println(" Complete.");
// Wait 1 minute
Serial.print(" 5. RESTING 1.");
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
digitalWrite(buzz, LOW); // turn the BUZZER OFF (Pin 12)
delay(1 * minutes); // wait for a set amount of off time
Serial.println(" Complete.");
// Gluten Development MIX Part 2b (mix for "mix" minutes) AND Add Salt (if forgot) (BUZZ'R)
Serial.print(" 6. PROOFING 2.");
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(buzz, HIGH); // turn the BUZZER ON (Pin 12)
delay(mix * minutes); // wait for a set amount of on time
Serial.println(" Complete.");
// 5. Rest for "rest" minutes #1
Serial.print(" 7. RESTING 2.");
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
digitalWrite(buzz, LOW); // turn the BUZZER OFF (Pin 12)
delay(rest * minutes); // wait for a set amount of off time
Serial.println(" Complete.");
// 6. Fold #2 - Run Mixer for "fold" seconds
Serial.print(" 8. FOLDING 2. (where is fold 1?).");
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(fold * seconds); // wait for a set amount of on time
Serial.println(" Complete.");
// 7. Rest for "rest" minutes #2
Serial.print(" 9. RESTING 3.");
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(rest * minutes); // wait for a set amount of off time
Serial.println(" Complete.");
// 8. Fold #3 - Run Mixer for "fold" seconds
Serial.print("10. FOLDING 3.");
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(fold * seconds); // wait for a set amount of on time
Serial.println(" Complete.");
// 9. Rest for "rest" minutes #3
Serial.print("11. RESTING 4.");
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(rest * minutes); // wait for a set amount of off time
Serial.println(" Complete.");
// 10. Remove Dough - Run Mixer for "fold" seconds to ball dough
Serial.print("12. BALLING 1.");
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(fold * seconds); // wait for a set amount of on time
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(10); // wait for a set amount of off time
digitalWrite(buzz, HIGH); // turn the BUZZER ON (Pin 12) to alert completion
delay(1 * minutes); // wait for a set amount of on time
digitalWrite(buzz, LOW); // turn the BUZZER OFF (Pin 12)
delay(5 * minutes); // wait for a set amount of off time
digitalWrite(buzz, HIGH); // turn the BUZZER ON again (Pin 12) to alert completion
delay(1 * minutes); // wait for a set amount of on time
digitalWrite(buzz, LOW); // turn the BUZZER OFF (Pin 12)
delay(10); // wait for a set amount of off time
Serial.println(" Complete.");
}
void loop() {
// put your main code here, to run repeatedly:
}