So the sketch is to run a home brew kit to make beer, using a "full volume mash" method, once all the mash is complete controlled by a BSC 460, I want a "mashComplete" signal from the BSC460 so open an auto valve to run the mash liquor in to a boil kettle at a controlled rate over a 1 hour period then stop all functions.
Ive attached the Sketch I have so far there is changes to make but I want to understand why its stepping through the switch cases.
Im watching this run via the serial port so I can see it step through straight away.
You should use autoformat and then you can see the issues in your code.
This is really messed up:
if (MashComplete == HIGH)
{
Serial.println("HIGH");
if (MashComplete == LOW)
{
Serial.println("LOW");
}
if (MashComplete == HIGH);
{
section = section + 1;
}
break;
}
First of all, you will not hit the break unless MashComplete == HIGH otherwise it will fall thru to the next case.
Secondly, if MashComplete == HIGH why are you checking for MashComplete == LOW within that code block? You are also checking again for MashComplete == HIGH but you have a ; after the conditional so it is useless anyway.
It should be set low until the BSC460 sends a signal to set I high, the mash takes 1 hour to complete so it shouldn't do any thing till then, thats what im panning any way, so the serial port should show it as low till then.
I appreciate the code may be wrong which is why I asked for help.
It should be set low until the BSC460 sends a signal to set I high, the mash takes 1 hour to complete so it shouldn't do any thing till then, thats what im panning any way, so the serial port should show it as low till then.
Suppose I gave you a glass of liquid, and said "Taste this. If it's beer, go through door #1. If it's grape juice, go through door #2.". You taste it, and say "It taste's like weasel (DELETED). I say "Well, that's Budweiser, so go through door #1".
Would it make ANY sense for anyone in the room beyond door #1 to ask if you glass contains apple juice?