thomas_pittin
Posts: 4
Joined: Tue Aug 05, 2014 1:45 pm

Control 2 dc motor with joystick and L293D

Sun Sep 21, 2014 11:01 am

Hello all,

I explain my request

I use a raspberry pi rev. B, 2 DC motor and 1 L293D

I connect the DC motor to L293D, raspberry pi

I also plug the usb joystick to my raspberry pi

my problem is: how can I control my DC motors with the joystick?

thanks in advance

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Control 2 dc motor with joystick and L293D

Sun Sep 21, 2014 7:32 pm

First you need to prove the L293 is connected correctly by writing a simple program to run the motors backwards and forwards.

Once you have the motors setup correctly you will need to handle translating the USB joystick commands into your (already working) motor driving program.

Your USB Joystick will need to already have linux drivers (preferably already have Raspberry Pi drivers). Hopefully your joystick will have the required documentation for you to proceed further.
Doug.
Building Management Systems Engineer.

thomas_pittin
Posts: 4
Joined: Tue Aug 05, 2014 1:45 pm

Re: Control 2 dc motor with joystick and L293D

Sun Sep 21, 2014 7:57 pm

The connection of the L293D is correct because I try a simple program that show me the moviments of the wheels.

how can I translate the USB joystick commands into my motors driving program?

I don't know how can I do

thanks

User avatar
Ferdinand
Posts: 236
Joined: Sun Dec 01, 2013 2:24 pm
Location: Leiderdorp, NL

Re: Control 2 dc motor with joystick and L293D

Mon Sep 22, 2014 12:33 pm

Hello Thomas,

I found this post:

http://www.raspberrypi.org/forums/viewt ... 9&p=354237

Good luck with your project.
Success with your project!
Ferdinand

Return to “Automation, sensing and robotics”