Using PIR sensor to light up two LED's depending on if sensor is activated or not. I want a green LED if the sensor is not activated and a red LED if it is activated. When I run my code the green LED is lit (sensor deactivated) which is correct. I then activated the sensor and the green LED goes off and the red LED comes on (correct). However, the red LED then remains on and does not go off even though the sensor is de activated. The green LED also does not come back on.
Hello arduino10134
Use names for the port pins, avoid magic numbers.
I guess the pinMode for the second unknown LED is missing.
Have a nice day and enjoy coding in C++.
@arduino10134
What has this to do with installation and troubleshooting?
I have moved this to a more appropriate place on the forum. I note that in your other question the forum instructions were brought to your attention but it seems that so far you have not read them. Please read them before posting anything else.