I am trying to read 24 digital inputs as part of a project I am working on. Also to teach me more about coding.
The problem is that for some reason my Arduino Mega does not latch the reading when it is high.
I have started small, only 2 channels with the hopes of making them work and then add more channels as I go, and also learn better ways to do the code.
At the moment, when I remove the jumper from the 5V of the Arduino to PIN22 it displays the Channel number in the right line on the LCD.
But when I put it back in 5V pin it simply bounces between HIGH and LOW on the LCD display, as if it reads it HIGH and LOW at the same time.
I have tried many combinations of code and simply cannot get a stable HIGH reading...
PLEASE can anyone assist in showing me my mistake?
As you can see from PHOTO, the 22 is dimm as it is jumping HIGH and LOW
You have configured your inputs to use the internal pullup resistor; in which case the jumper / switch must be wired between pin and GND. So I do not understand what you mean by At the moment, when I remove the jumper from the 5V of the Arduino
The below should just be a else; else does not take a condition.