Servo control with joystick modules or potentiometers

Seing if this JPEG file stays attatched, This is the picture of my wiring...

I used 50k potentiometers instead(cos thats what i had) of the 10k sugested.

And with that code sketch that Robin2 fixed up for me it all works perfectly.

Im blown away iv managed to actuly compleete a arduino project i customised to suit me.

All my parts iv made by hand my self, And once its all assembeled i shall post some more pics of it all together.

I realy want to get it all on a prototype board tho.

I have seen somewere that the external power source coming in should run through a "voltage regulator and then a capacitor of some sort, And then branch of at the capacitor to connect other servos..(ill look for of picture of it aswell).

Hi,
Ops circuit;

A 0.1uF capacitor on each of the pots analog input to gnd, will also help.

Tom... :slight_smile:

Sweet, Thanks for that Tom, Now people can 2 and 2 together.

Silly question for ya, Im sorry if im a little nieav to some of this, Are you refering to the blue wires ?

This is the sort of thing i had in mind

Please make your image visible in your Post. I gave you a link to the instructions in Reply #14

...R

Sorry robin but thats bullshit, I shouldent have to do.. all that just to display an image , I provide a link < iv tried uploading but it times out on me all the bloody time "Sorry"

I realy realy apresheate the help and giudence with my project problems, But somethings are more difficult for me, Im doing my best, But obviously its not good enough for some people..

Hi FLCFLC. Relax a bit. Robin2 is helping you and you want to keep it that way.
You were able to attach a image to reply #20. If you follow the image guide that Robin2 suggested in reply #14, then all forum members can see the image quickly and easily.

It is the right way to get us to help you.

Yes, new members often get a lot of corrections on forum etiquette. If you want to reduce that, read the 'How to use this forum - please read' post. It covers the most frequent issues that new forum members run into.

It is not that we are trying to force you to do it our way. It is that we have seen a very great number of new users try to get help and run into problems with how to present the information. The 'How to use this forum - please read' post shows you how to present your information so that you maximize the opportunity for help.

FYI: Here is the roughly equivalent sketch using arrays and structures. I switched to Servo.writeMicroseconds() which has better resolution than Servo.write(). The settings structures allow for limits to the range of values expected from the joystick pots, allowing full range of control using physically limited inputs. The settings structures also allow for limiting the range of motion of the servos to avoid hitting physical constraints.

// Using structures and arrays to associate data
#include <Servo.h>

const byte AXIS_COUNT = 6;

Servo Servos[AXIS_COUNT];

struct AxisSettings
{
  byte servoPin;
  byte analogPin;
  int analogMinimum;
  int analogMaximum;
  int servoMinimum;
  int servoMaximum;
} Axes[AXIS_COUNT] =
{
  {2, A0, 0, 1023, 1000, 2000},
  {3, A1, 0, 1023, 1000, 2000},
  {4, A2, 0, 1023, 1000, 2000},
  {5, A3, 0, 1023, 1000, 2000},
  {6, A4, 0, 1023, 1000, 2000},
  {7, A5, 0, 1023, 1000, 2000}
};

void setup ()
{
  for (byte i = 0; i < AXIS_COUNT; i++)
  {
    Servos[i].attach(Axes[i].servoPin);
  }
}


void loop ()
{
  for (byte i = 0; i < AXIS_COUNT; i++)
  {
    int analogValue = analogRead(Axes[i].analogPin);
    int servoPosition = map(analogValue, Axes[i].analogMinimum,  Axes[i].analogMaximum,  
                                                           Axes[i].servoMinimum,  Axes[i].servoMaximum);
    Servos[i].writeMicroseconds(servoPosition);
  }
}

Wow, Thank you very much john, Nicework.

And I must appoligise if i seemed a little cranky the other day.