interfacing a wired rc car controller and two 24v dc mtors to an atmega8 arduino

hey folks, top of the day to you all, . . . .here's my problem i have here, with me 2 dc motors operating on 24v dc, and i'm planning to inteface it with my arduino diecimila(atmega through an L293D h-bridge driving ic. which takes an input from the arduino(which is the output i trigger through my program to the respective ic pins) and drives the motor with a high current of upto 10 amps.

now, here's the real pain, . . . . . i have with me, an old rc car controller( the classic up,down || left,right) which through a lil bit of modification, i will transform into, a wired controller, whose outputs(viz. forward,reverse, left,right) i'll be assigning as inputs to my arduino.

now i dont really know where to put these inputs(analog or digital) and how to modify my program, or make a new program to accommodate these functions.

i want my bot to move : front when i press forward reverse when i press backward turn left when i press front and left turn right when i press front and right reverse left when i press back and left reverse right when i press back and right take a 360 continuously left when i press only left take a 360 right continuously when i press only right

i'm using differential steering and the functions described above (front, reverse etc) must me mandatorily present in my program. i want digital high or low to be triggered accordingly by analyzing my controller input(i.e front, back, left right)

i hope you folks can help me out. .. .

thanks a damn!!!!

which through a lil bit of modification, i will transform into, a wired controller, whose outputs(viz. forward,reverse, left,right) i'll be assigning as inputs to my arduino.

Are you removing the pots around the joystick and just having switches (digital) or are you leaving the pots (analog)? Which you do makes a big difference.

now i dont really know where to put these inputs(analog or digital) and how to modify my program, or make a new program to accommodate these functions.

I could suggest that you need to change lines 68 to 144, but, really, without seeing your code, I'd just be blowing smoke.

i'm using differential steering and the functions described above (front, reverse etc) must me mandatorily present in my program. i want digital high or low to be triggered accordingly by analyzing my controller input

Sounds like a homework assignment, to me, and that you missed the point. The joystick (analog) values should control more than the direction and on/off nature of the motors. They should control the direction and speed.

hey paul, thanks fr replyin, , ,
firstly, i’m workin on a bot which in a span of 14 days , i will have to transform into a battle bot. . .so, no, its not a homework assignment, pretty much of a hobby i presume…

secondly, i was thinkin may b you could create a few lines of code to accomodate the functions i described, not necessarily modify my code. i’d try to understand ur code and then translate it to suit my conditions.

my rc car controller is a classic one, with the spring analogs(front,back and left,right)
i have attatched a pic of it for ur perusal. . . .

i want to connect these outputs(4 of them) to my arduino inputs. this is the part i want you to help me with, i have no idea whatsoever, to connect these outputs. and where to? wheter analog or digital, and if either, how to modify my program or write an entire new one to read the signal from the output of the controller and control my motors respectively. . .

thanks again

the silver(or probably steel) bent contacts under the spring switch on both sides(forward rev l and r) are gonna b attached to wires that i will solder onto them and these leads will be fixed to jumpers (m/f) to act as inputs to the arduino. . . if i am right these inputs show an analog voltage signal upon interaction with the contacts, so maybe i'll have to put them in the analog input ports of the ard. Again, i aint sure bout it.

if analog, how am i supposed to write my program such that when a signal is present, i can vary digital output pins of the arduino to high or low, so that my motor runs via L293D ic.

in short, i wanna read analog, and vary digital output based on what i read.

thnx!!

triven: i want to connect these outputs(4 of them) to my arduino inputs.

You're referring to 'spring switches' in the control unit. The picture seems to show a couple of joysticks. I guess they are single axis joysticks - this configuration is typical for two-channel remote control systems. On cheap models each joystick may just be connected to a couple of limit switches, but more usually each joystick will be connected to a single potentiometer which can be used to give you an output voltage proportional to the joystick's position. Which type do you have?

There was an instructable similar to this that I read a while back. Do a google search for remote control lawn mower. He basically did this but with an FM remote for an RC car. He posted all his code, Bills of material, etc.

Allen

well peter, i guess its limit switches for me. . . . . . if so, how do i write a program to read the status of the outputs of the 2 single axis joysticks? and mainly, once i have the outputs what are the inbuilt functions to read analog values and vary digital outputs in an arduino??

thanks a damn alinosa, ,, , i'll giv it a try!!

any chance maybe i could get a link????? rc lawn mower?

triven: well peter, i guess its limit switches for me. . . . . . if so, how do i write a program to read the status of the outputs of the 2 single axis joysticks? and mainly, once i have the outputs what are the inbuilt functions to read analog values and vary digital outputs in an arduino??

If each joystick is driving two limit switches then you just have four switches to read. There are plenty of example sketches that show how to read a switch using a digital input, and you just need to do that four times. Obviously the three possible states of each joystick tells you whether you need to move forward/stationary/backward and left/straight/right and you need to set your outputs accordingly.

thanks peter, any chance maybe i could get a link???

triven: thanks peter, any chance maybe i could get a link???

A link to what, exactly?

a link to any such code you may have found which suits my specifications. . . . . .

anyway , apart from that, i found out that if my controller pins are given to the analog inputs of the arduino i.e A0 A1 A2 A3 respectively, and using the analogRead() command i can convert any voltage at the input(from a 0 to 5v range) to 10 bit resolution i.e 0 to 1023. . .now all i wanna know is how do adjust my digital outputs (not the A0 , A1 etc) on the other side of the board according to the analog values.?

triven: a link to any such code you may have found which suits my specifications. . . . . .

You're being silly.

Of course I can't refer you to any example code that shows how to link your specific remote control system to your specific type of motor. I doubt that anybody else in the world has implemented that specific solution.

However, when you break the solution down into its constituent parts they are all commonly done and there are plenty of examples around. I've already listed the functions that I would break it down into. No, I'm not going to link you to an example for each function, since some of them are trivially easy to find and the others are not hard to find. I'm not prepared to do the work for you if you aren't going to make even a token effort to work these things out for yourself.