Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beeper added #1

Merged
merged 2 commits into from Jan 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 19 additions & 1 deletion ReflowController/ReflowController.ino
Expand Up @@ -6,6 +6,7 @@

//#define FAKE_HW 1
//#define PIDTUNE 1 // autotune wouldn't fit in the 28k available on my arduino pro micro.
//#define WITH_BEEPER // Enables Beeper

// run a calibration loop that measures how many timer ticks occur between 2 zero corssings
// FIXME: does not work reliably at the moment, so a oscilloscope-determined value is used.
Expand Down Expand Up @@ -57,6 +58,7 @@ const char * ver = "3.1";

#define PIN_HEATER 0 // SSR for the heater
#define PIN_FAN 1 // SSR for the fan
#define PIN_BEEPER 5 // Beeper Out

#define PIN_ZX 2 // pin for zero crossing detector
#define INT_ZX 1 // interrupt for zero crossing detector
Expand Down Expand Up @@ -734,7 +736,9 @@ void abortWithError(int error) {
tft.print("during ");
tft.println((error == 10) ? "heating" : "cooling");
}

#ifdef WITH_BEEPER
tone(PIN_BEEPER,1760,2000); //Error Beep
#endif
while (1) { // stop
;
}
Expand Down Expand Up @@ -1008,6 +1012,10 @@ void setup() {

delay(1000);

#ifdef WITH_BEEPER
tone(PIN_BEEPER,1760,100);
#endif

menuExit(Menu::actionDisplay); // reset to initial state
Engine.navigate(&miCycleStart);
currentState = Settings;
Expand Down Expand Up @@ -1276,12 +1284,22 @@ void loop(void)
PID.SetControllerDirection(REVERSE);
PID.SetTunings(fanPID.Kp, fanPID.Ki, fanPID.Kd);
Setpoint = idleTemp;
#ifdef WITH_BEEPER
tone(PIN_BEEPER,1760,1000); // Beep as a reminder that CoolDown starts (and maybe open up the oven door for fast enough cooldown)
#endif
}

if (Input < (idleTemp + 5)) {
currentState = Complete;
PID.SetMode(MANUAL);
Output = 0;
#ifdef WITH_BEEPER
tone(PIN_BEEPER,1760,500); //End Beep
delay(500);
tone(PIN_BEEPER,1760,500);
delay(500);
tone(PIN_BEEPER,1760,1500);
#endif
}

#ifdef PIDTUNE
Expand Down