code for arduino uno to make motors go all directions

hi guys,i wanted help in code for this,i have made a 4 button remote for arduino uno now i want to program it to go forward backward side,i have given diagram,please help

regards,Aman(my real name)

Switches will not go anywhere on their own. So what is the thing that should go forward/backward and sideways? What other components are in that device?


the motors are connected to arduino through l23d ic chip on breadboard,i have 4 motors to move so i have 2 l293d ic chips,i want the motors to move in all directions through 4 buttons which i have made
i dont know how to code it for that

The first thing to do is to detect whether a button is pressed and if so, which one

Have you managed to do that ?

And when you've done that write some simple code to move the motors. Google can find you thousands of examples of driving motors via an L293. When you have both switches and motors working separately combine them and you're basically there.

If you have problems post your code with an explanation of what happens and what should happen.


i will do that,thanks slipstick

Your schematic shows your analog input pin connected directly to Ground. It will always read 0. Put a resistor between A0 and Ground.