0

LED dim when using arduino logic

int President = 0;

int UncleHomer = 0;

int Army = 0;

int AirForce = 0;

void setup()
{
pinMode(9, INPUT);
pinMode(12, INPUT);
pinMode(11, INPUT);
pinMode(10, INPUT);
pinMode(5, OUTPUT);
}

void loop()
{
President = digitalRead(9);
AirForce = digitalRead(12);
Army = digitalRead(11);
UncleHomer = digitalRead(10);

if (President == HIGH &&
(UncleHomer == HIGH || AirForce == HIGH || Army == HIGH))
{
digitalWrite(5, HIGH);
} else {
digitalWrite(5, LOW);
}
if (AirForce == HIGH && Army == HIGH && UncleHomer == HIGH)
{
digitalWrite(5, HIGH);
} else {
digitalWrite(5, LOW);

 

 

When I run this sketch, and use the buttons connected to pin 9 and any other input, the LED is very dim. Any ideas?
}
delay(10); // Delay a little bit to improve simulation performance
}

3 comments

Please sign in to leave a comment.