Would this work ? - New to arduino

So, basically, what i want to do with this code. Im sensing an input of 5v on pin 1, if the pin goes high, it turns on the pin 2. If the pin 1 doesnt go back down to LOW state by itself, it turns it off in 10 seconds ( from the moment it went high ). Would it work ?

Screenshot_1.png

Pin 0 and 1 are used for serial communications.

You need ; at the end of your lines of code.

ca5a2fe7e31f81f55f648b5da4a2e8ba1b8910a7.png

You will need another delay() after the 2nd digitalWrite.

Try things for yourself. :wink:

DxMoose:
So, basically, what i want to do with this code.

Please don’t post pictures of code. Just copy and paste the code. And post the complete program.

…R

PS … To make it easy for people to help you please modify your post and use the code button </> so your code looks like this and is easy to copy to a text editor. See How to use the Forum