i want to use arduino as a automatic switch that that short circuit two pins after a time (eg: 15 seconds )
i have 2 wires that are connected to 2 different pins on the arduino board and I need to short circuit them for 1 sec but it has to short circuit after 15 seconds when arduino is turned on , and i want to loop this
i need the code
ASAP , i need the code for my project by tuesday
.
another way without the relay,
by using a transistor or something that gets on after 15 seconds? and the transistor as a switch,, the transistor has to be turned on after 15 seconds
all i need is the code
You cannot use the arduino to connect wires together. It is not a switch.
You will need to connect a controllable switch (relay) to a single wire of the Arduino. When the Arduino pin is high (5V), it would close the switch, and when the Arduino pin is low, the switch would be open.
It terms of code, the millis() command tells you how many milliseconds have occurred since the Arduino has started. Also, the delay() command allows to to wait a certain number of seconds. You could use these commands to time things.
ps: You will not get this done by tomorrow. If this is an assignment for University, you should have started before today.
I have given you hints about what you need to look into. Assignments are given so that you learn. It would be unfair to others to post the answers for you.
fungus:
To me it sounds like he's hacking a remote control, which has been asked a million times here.
He is however, as is so common, failing the comprehension test which is - explain what you really want to do, rather than how you imagine you want to do it, but wouldn't be asking if you actually knew.
Hacking a remote control requires a transistor and a multimeter to figure out which way to connect it. Actually, much simpler - a 74HC4016 in which case you can do up to 4 buttons and don't care which way round to connect the terminals.