Hi Folks,
I've been working "full time" on a project for a couple of weeks (well ....being married, with 2 kids, working full time, actually mean 2-3 hours/week)
it is basically a system, that has a hard wired LCD (1602) , a couple of buttons, etc... The "brain" is an Arduino Nano
Everything has been working for a while, but yesterday, I busted my Nano.
So I uploaded to a new one, but once powered, nothing worked: LCD had nothing, buttons were no longer creating any reaction...flat line !
at the beginning of my program, I declare my pins (no need to embed the actual code):
boolean Setup = 2;
boolean Enter = 3;
boolean Next = 4;
boolean Inc = 5;
boolean Dec = 6;
boolean RS = 7;
boolean EN = 8;
boolean D4 = 9;
boolean D5 = 10;
boolean D6 = 11;
boolean D7 = 12;
boolean Start = 13;
boolean Stop = 14;
boolean Buzzer = 15;
I did install a couple of trap, pushing the result on the serial port: basically, my inputs were no longer working, even if physically, the voltage level on the pin would change....Weird, I thought....
I finally found my issue: my pins were declared as a boolean, rather than an Integer !!! As soon as I changed them for "int" everything worked...again !
"Again" ...That's the part that I don't get !
Why has it been working before ? Shouldn't the compiler have told me " Hey buddy, a boolean with a value of 4 !!! Really ???"
OK let's assume that everything greater than 0 is considered as a '1'. Why , all sudden, it was no longer the case ?
puzzled ....