I'm just starting with Arduino, but I was thinking of using a code in order to make a traffic light change to green if an object remains within the range of a sensor for 2 seconds, but I'm sure how to code it. I'm thinking of using millis, but I'm not sure about the syntax when using it. Can anyone help? Even sample codes are useful.
Show us what you have so far and explain what it does currently. Post a schematic. Post your code (use code tags). Post links to the important components. Important: read the forum guide in the sticky post so you know how to post all those things correctly.