I am completely over my head on a project that I have been working on. I have been wanting to create an RC tank for some time now and finally have the time to do it. I have bitten off more that I can chew..
I have some background in electronics however when it comes to the programming side I am lost. so far I have been able to make a DC motor spin one direction or the other using very basic commands. (Left, right, and stop) but when it comes to using a dual motor setup, with joystick apps on my android that is where I am stuck. I am hoping someone could direct me to the right place where I can gather the info I need to make this project work.
I am currently using Arduino Nano, L293D, and an HC-05. They are all wired up to my 2x DC motors, now it is just a matter of finding the right app, and the right coding.
Presumably the HC-05 is connected as a serial device. If that is so then the Android app needs to send data relating to the "joystick" position so that it can be read by the Arduino and acted upon.
For a 2 joystick, 2 motor system you will need to send 4 different pieces of data. Left x, right x, left y and right y. For the Arduino to interpret these, each will need a unique identifier and it will help if each piece of data is separated by a delimiter. You can invent any protocol that suits you but something like sending <LX123,RX200,LY99,RY456> would make it relatively easy to split the string and assign values to Arduino variables.
Thank you so much! I hate to be such a bother but do you know of any apps that would work for what I need? Right now I am testing with just one DC motor and one simple joystick but as I try to increase the "throttle" my motor just freaks out and jerks and spins in totally different directions. I think I might just have to start from step one in programming and maybe a new app.
Any suggestions on an app to use? I am thinking even a simple dimmer switch setup x2
reallyfastlearner:
Right now I am testing with just one DC motor and one simple joystick but as I try to increase the "throttle" my motor just freaks out and jerks and spins in totally different directions.
You need to post the program so we can see what you can see.
Am I correct to assume that when the joystick is in the centre the motor should not move and the more you push the stick forward (or pull it back) the faster the motor should move?
Yes that is the plan to have the motor increase speed in either direction. I have been playing with an app called bluetooth joystick. It was created by YMSoftLabs.