SparkFun Forums 

Where electronics enthusiasts find answers.

General project discussion / help
Did you make a robotic coffee pot which implements HTCPCP and decafs unauthorized users? Show it off here!
By aww
#198681
I'm sure is a simple matter for most here. This is my first time using Arduino and I haven't been able to find the specific answer to my problem so any help would be appreciated.
I need an arcade type momentary push button to turn on two different motors, both 125 volt, for a different period of time for each and then turn off until the next time the button is pushed. So, a person pushes the button, releases 1/2 second later. When they push, both motors turn on at the same time and then one runs for 10 seconds and the other runs for 12 seconds. Then they both turn off and stay off until the button is pushed again, so there is no repetition.
I have the 12v illuminated arcade switch, an Arduino uno, a relay. I've found plenty of debounce programs. I've found information on switches that, when pushed turn on an led and when pushed again, turn it off, and switches that will power the led as long as the button is held. But I haven't found anything about a switch that, when pushed for any amount of time, sets the above process into motion. Arduino code and wiring help would be great. For example, to wire the switch do I need to make a circuit that begins and ends in the Arduino, except for the illumination of the led in the switch?
By Valen
#198696
Start with learning the basics of Arduino programming first. Plenty of examples for that. Don't worry about your project immediately. Learn how to detect switch states. Turn on leds before using high power relays and motors. Learn how to loop and use conditional code first. For the timing you would want to look at the blink-without-delay example. Once you learned those early basic steps you can integrate them and apply them for your project. But do be carefull with that 125 volt motor. Consult others with experience in electronics. If you are not familiar with electronics then leaping that far ahead on your own is asking for trouble.