Help Needed!!

I need to know if it's possible to have a joystick, or just use the keyboard on a computer, the computer is connected to a router, this router is bridged to another router which has an arduino duemilanove and ethernet shield plugged into it.
I need to be able to control a DC motor and a steering servo over this connection?

Any help would be incredibly appreciated! I am running out of time :s

just a nit pick, help needed is a bad choice of topic for future readers

and what Richard said is dead on, so it will take some reading to pull off :wink:

I'm sorry, i had posted once a few weeks back and it had no replies and i saw another post with similar name that had replies.

It is getting a bit more serious now as i have to complete my project my August :s

Is there anywhere you reccommend i start looking for the writing software to allow the joystick to be compatible with arduino?

Any links to tutorial sites or similar projects would be fantastic :slight_smile:

Or do you know of a simpler way to control two dc motos and a servo over a wireless connection??

Chris :slight_smile:

Or do you know of a simpler way to control two dc motos and a servo over a wireless connection??


well the problem with R/C is that i need range of like 200m and i am also transmitting live video and audio through the router.

I would like to keep it all over the wireless network.

well the problem with R/C is that i need range of like 200m and i am also transmitting live video and audio through the router.

And you leave it until now to drop this vital piece of information!

Perhaps the best way would be with an Ethernet shield and some web server software.

For the control of the motor and servo, R/C is still the best.
How you get video back is up to you.

Well it was mainly just the control aspect that i was worried about, i have people who can help me with the bridging and network connections.

Well i would rather have my video and control with the same range, using R/C will have a shorter range than what i would like.

I am sorry if what i am saying is garbage, but i am new to the arduino platform and don't have that much experience.

This is for my year 12 Major Design & Technology project in Australia.

So if i set up an ethernet shield could i write a program that means you could control the steering and drive in an internet browser or something similar?

Would this be easier if i used an ESC from an RC car, or build some sort of H-bridge?

well to get input from a joystick you can use python with the library pygame. its very easy to detect the joystick and to get the data.
I used the code below to read data from a xbox controller and send it to the arduino via serial.

import sys, pygame, serial, time
from pygame.locals import *

ser = serial.Serial('COM7', 9600)


size = 300, 60

screen = pygame.display.set_mode(size)

njoy = pygame.joystick.get_count()

y = 90
z = 0
button1 = 0

for j in range(njoy):
    gamepad = pygame.joystick.Joystick(j)

clock = pygame.time.Clock()
keepGoing = True

while keepGoing:
    for event in pygame.event.get():
        if event.type == JOYAXISMOTION:
            if event.axis == 0:
                x = event.value
                if x < -.07 or x > .16:
                    if x < 0:
                        y = 90 * abs(x) + 90
                        y = int(y)
                        y = -90 * abs(x) + 90
                        y = int(y)
                    y = 90

            if event.axis == 2:

                w = event.value
                if w <= 0:
                    z = 0
                if w <= 1 and w > 0:
                    z = 255 * w
                    z = int(z)

        if event.type == JOYBUTTONDOWN:
            w = event.button
            if w == 0:
                button1 = 1
            if w == 2:
                button1 = 0

    if event.type == pygame.QUIT:
        keepGoing = False


The last two days I've been tinkering with my arduino with ethernet shield. From what I see you should be able to do most of what you want to do fairly easily. Use two high power wireless routers in bridging mode for the wireless part. Connect a computer to the stationary router and connect an arduino with an ethernet shield to the router on the bot. Connect an IP cam to the router on the bot. I've currently have an ssc-32 servo controller connected to the aduino and controlling the servos via a web page. Joysticks may not be well suited for use with the HTTP type of traffic. You would just have to experinent to see what works best.

Wow, so with that code from the Xbox can you take the data and turn it into code that can be used to control servo's and an ESC on the rover?

Zoomkat, thankyou very much for the assurance that it is possible, made me happier :slight_smile: So does this mean that i am going to need an SSC 32 to control these motors?
I was thinking that i should be able to control a servo and an ESC which will be connected to my ethernet shield and be getting information over the wireless bridge connection?

Do you know anywhere i can get examples of making a web server to control this?
I think i know you from the trossen robotics forum? is that the same zoomkat?

Chris :slight_smile:

this website has the code to read all of the buttons, joysticks etc.. from the controller
I got the code from there and edited.

yes you can use it to send data. python also supports networking so if you are going to send the data through the internet you could code everything in python, and its not very hard to write a simple server or client in python.

Yes, it is the same zoomkat. I got curious about the capabilities of the arduino/ethernet shield combo, in particular the web server that the arduino can impliment, so I got the combo. The below link is where I was sorting out capturing a get request. Currently I have a working control setup where PC web page > wifi > unmodified netgear wireless router > cat5 cable > arduino/ethernet shield > rs232 > ssc-32 servo controller > servos. I use the ssc-32 as 1) I already have one, and 2) it saves a lot of arduino servo programming. I'll probably work on getting a barebones program for the arduino and web control page this weekend. For video, you would need an IP cam connected to the router (~ $80 on ebay).