Either you can unsolder the pins on the motor shield and replace them with header pins. Not an easy task but doable if you're careful. The Adafruit motor shield has an additional set of solder pads on the inboard side of the pins. I can see them in your photo. The Adafruit forum has a 'sticky' post telling you which pins are not used by the motor shield and, therefore, available for use by your joystick controller.
Or you can buy a protoshield, to connect your joystick controller to, and put the protoshield between your Arduino and the motor shield.
Thanks Henry_Best. I ended up accessing the solder pads as you described using a few rescued headers. How ever, I am now getting strange readings from the joystick when the motors are turned on. Is there a way of reducing this interference?
Thanks also to James C4S although I wont answer your questions as the problem has been solved.
brandoncaddoow-young:
Thanks Henry_Best. I ended up accessing the solder pads as you described using a few rescued headers. How ever, I am now getting strange readings from the joystick when the motors are turned on. Is there a way of reducing this interference?
Which Arduino pin(s) are you using for your joystick?
brandoncaddoow-young:
I am using A0 and A1 for the joystick.
OK. They don't conflict with the motor shield so I suspect that your 'strange readings' from the joystick are a lack of power problem. How are you powering your motors?
That would make sense. I will take a picture of my own project later but I am connecting the dc motors just like the person did in this picture. However I am connecting 4 rather than 1.
Henry_Best:
OK. They don't conflict with the motor shield so I suspect that your 'strange readings' from the joystick are a lack of power problem. How are you powering your motors?
Henry_Best your point on the power has led me to an idea.
Would it work if I powered the motor shield(see image below) using one set of batteries and the Arduino UNO using another set of batteries? Would this mean that the joystick would pull from a different power supply to than the motors?
brandoncaddoow-young:
Henry_Best your point on the power has led me to an idea.
Would it work if I powered the motor shield(see image below) using one set of batteries and the Arduino UNO using another set of batteries? Would this mean that the joystick would pull from a different power supply to than the motors?
Yes. That's why I asked that question. The motors are trying to draw more power than the Arduino regulator can supply (500mA) and causing it to corrupt the analog readings. Powering the motors from a separate supply should cure that. Make sure both grounds are connected together.