Hey Guys,
I have a HD44780-based LCD with a Modern Device LCD117 Serial LCD Board --> Displays – Modern Device
I have some code that has been running merrily for the last six months and i have added a couple of more if arguments to it and now it is dropping commands that i send to it. i have spent over 2 weeks trying to work out why! :-[
example
============================================
OLD CODE
HABS v0x00?n?n Start to Begin?n Select for Setup
f Select Mode?n?n A for Manual?n B for Automated
NEW CODE
HABS v0x00 Start to Begin?n Select for Setup
B for Automated
===========================================
as you can see i
this is the old code
// for hlt element ssr
if ((state & NES_SELECT) and (ReadPinElementHlt == LOW))
{
digitalWrite(PinElementHlt, HIGH);
Serial.print("?x00?y1ON ");
}
else if ((state & NES_SELECT) and (ReadPinElementHlt == HIGH))
{
digitalWrite(PinElementHlt, LOW);
Serial.print("?x00?y1OFF");
}
// for hlt pump ssr
if ((state & NES_START) and (ReadPinPumpHlt == LOW))
{
digitalWrite(PinPumpHlt, HIGH);
Serial.print("?x04?y1ON ");
}
else if ((state & NES_START) and (ReadPinPumpHlt == HIGH))
{
digitalWrite(PinPumpHlt, LOW);
Serial.print("?x04?y1OFF");
}
and this is the new code added to the bottom
// for mashtun pump ssr
if ((state & NES_B) and (ReadPinPumpMT == LOW))
{
digitalWrite(PinPumpMT, HIGH);
Serial.print("?x09?y1ON ");
}
else if ((state & NES_B) and (ReadPinPumpMT == HIGH))
{
digitalWrite(PinPumpMT, LOW);
Serial.print("?x09?y1OFF");
}
// for mash stirrer ssr
if ((state & NES_A) and (ReadPinMotorMT == LOW))
{
digitalWrite(PinMotorMT, HIGH);
Serial.print("?x13?y1ON ");
}
else if ((state & NES_A) and (ReadPinMotorMT == HIGH))
{
digitalWrite(PinMotorMT, LOW);
Serial.print("?x13?y1OFF");
}
If someone could explain why adding a couple of arguments would cause erratic behavour i would be forever grateful
Cheers Rob.