Maintenance notice: These forum archives are read-only, and will be removed shortly. Please visit our forums at their new location, https://www.evilmadscientist.com/forums/.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
if (PINB & 1) // Make sure that cancel pin is HIGH (not active):
{
resetTimer();
StopTime = calculateStopTime();
TurnCoilOn();
Triggered = 1;
CoilOn = 1;
}
What you will want to do is to add the three-second delay at this point, maybe like so:
if (PINB & 1) // Make sure that cancel pin is HIGH (not active):
{
resetTimer();
StopTime = 3;
while ( seconds() < StopTime)
{}
resetTimer();
StopTime = calculateStopTime();
TurnCoilOn();
Triggered = 1;
CoilOn = 1;
}
(Keep in mind that this is untested code, but it might point you in the right direction.)