Hi, I am super new to ardiuno. I have LEDs and a dip switch. I am trying to make the dip switch work as a binary thing. i.e. if switch one is on and switch two and three are off the turn on a light. I obviously also need it to turn the light off if this condition is not met. I have been playing around with the code and this is what I found as a sollution
At a guess I'd think it would be something with how the switches and LED are wired and whether or not there is a pullup.
You can test those sorts of problems by making sure you can run the built-in examples on your hardware and making Blink work on your current LED connection and making Button work on your current dip switch connections.
That and all the others are wrong. The evaluation of that is either false (0) or true (1) so e.g. digitalRead(SWITCH_1_ == HIGH) will either read pin 0 or pin 1.
You need three digitalReads, one for each pin and combine those.
SWITCH_1_ has value 2 so all in all this part is doing
2 == HIGH:
HIGH isvalue1
so all in all you are executing
2 == 1 which results in "false" where "false" is value 0
So the result of "2 == 1" is 0
This part
(SWITCH_1_ == HIGH) results in 0
same thing for
(SWITCH_2_ == LOW) results in 0
(SWITCH_3_ == LOW) results in 0
all in all you are executing
0 && 0 && 0 which finally results in 0
so what you line of code
if (digitalRead(((SWITCH_1_ == HIGH) && (SWITCH_2_ == LOW) && (SWITCH_3_ == LOW))))
is really doing is
if( digitalRead(0) )
which means you are reading IO-pin number 0
and depending on IO-pin beeing HIGH the condition would result in true
on IO-pin beeing LOW the condition would result in false
again:
You have at mimium three wrong assumptions how this code works
you should really learn how to use digitalRead with a much simpler example
and work up from there
nobody here should make you stumble forward faster by presenting a working solution
You should do some more basic exercises before you work on this combining