I am wondering if there is a known issue with any specific batch of Arduino pro mini 5V 328. None of the last three units that I buy are evaluating the and (&&) condition in a code. Even the simplest code to control pin 13 LED with the change of two diferent pins condition is failing on my units.
Blick code was already used to confirm the state of pin13
Here is the simplest code that it fails to evaluate (cause the LED never goes off)
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
pinMode(3,INPUT);
pinMode(2,INPUT);
}
void loop() {
if ((digitalRead(3)==HIGH)&&(digitalRead(2)==HIGH));
digitalWrite((13),HIGH);
if ((digitalRead(3)==LOW)&&(digitalRead(2)==HIGH)) ;
digitalWrite((13),LOW);
}
Please advice and thanks in advance.