Push Button Program

Hi, I am having problems with my arduino push button, i have wired it up to two outputs (pin 12 & pin13) and i have the push button connected to (pin7).

I basically need the program to:

  • When the Arduino is powered up the motors do not turn
  • When the button is pressed the motors start their forward and backwards turning.
  • The motors should continue to turn when the button is released.
  • If the button is pressed again the motors should stop.
  • The motors should stay stopped when the button is released.
  • This should repeat i.e. pressing the button should start the motors again etc.

Can anyone please help me ?

and i have the push button connected to (pin7).

And what else? Post a schematic.

What do you have between the motors and the Arduino? The Arduino can NOT power motors.

I'm missing the problem... All I see is a program request. We have a different section for that.

But if you write it yourself that's even better! But then you have to show the program, show a diagram (because really, only connecting a button to pin7 will never ever do something (at least not what you want) because a switch has at least two connections for a reason and motors don't come out of thin air) and a full problem description (doesn't work doesn't cut the mustard).

Just had help from my lecturer :smiley:

Thanks.

You know who's a good lecturer as well? Google :wink:

Want to know something => Lecturer / Google / books (whaaaaaaaaat?!)
Stuck after research => Forum / lecturer
Don't want to research => Hire somebody :smiley: