Hi all. I'm working on a project with a servo and a light sensor. What I want is when the light sensor detects a value below the specified (400) for 30 seconds, the servo will move to position b, wait for 2 minutes, then move back to position a, then wait 5 minutes before starting the loop again.
This is what I've got so far and it works, I just don't know how to go about the first part. Right now when the value drops below 400 it instantly goes to position b. I want it to need 30 seconds of readings below 400 for it to do that.
Basically what's going on is my phone line wiring in my house is crappy (200+ year old house) and every once in a while the internet connection drops. I know it's not the modem as Verizon has sent several different ones and they've all got this issue. When the internet LED on the modem is out for more than 30 seconds (internet connection dropped), I want the servo to move and turn the power switch off, wait 2 minutes, then turn it back on, then wait 5 minutes to be sure the modem is fully powered up before reading again. This just saves me from having to run down 2 flights of stairs to reset it myself, which sometimes can be a daily occurrence. I need it to wait 30 second because the internet light flashes when there's traffic, so instant would be a bad thing lol.
Well it's not in the code because I've got no idea how to do it. I want it in with the "if(photocellReading <= 400);" part. I'm a noob to this kind of stuff with Arduino and have no idea how to set it up.