Hi, im building an ROV but finding the coding a bit challenging (only have minimal experience with arduinos). 2 joysticks will control the ROV which features 6 motors in vectored format, with 4 motors situated on each corner of the ROV for forward and backward motion, and 2 placed in the middle for upwards and downwards motion.
This is what I've got so far, am I on the right line or have I got it completely wrong? Any help would be much appreciated, don't really know where to go from here.
#include <Servo.h>
// Joystick Settings
static const int JS_CENTER_0 = 511; // Analog reading at center, 0-1023
static const int JS_CENTER_1 = 511;
static const int JS_CENTER_2 = 511;
static const int JS_CENTER_3 = 511;
static const int JS_CENTER_4 = 511;
static const int JS_CENTER_5 = 511;
static const int JS_RANGE_0 = 128; // Analog range, 0-1023
static const int JS_RANGE_1 = 128; // Set to 128 for Parallax joystick
static const int JS_RANGE_2 = 128;
static const int JS_RANGE_3 = 128;
static const int JS_RANGE_4 = 128;
static const int JS_RANGE_5 = 128;
static const int JS_DIR_0 = 1; // +1 or -1
static const int JS_DIR_1 = 1;
static const int JS_DIR_2 = 1;
static const int JS_DIR_3 = 1;
static const int JS_DIR_4 = 1;
static const int JS_DIR_5 = 1;
//Arduino pins
static const byte JS_ADC_0 = A0; //joystick pins
static const byte JS_ADC_0 = A1;
static const byte JS_ADC_0 = A2;
static const byte JS_ADC_0 = A3;
static const byte JS_ADC_0 = A4;
static const byte JS_ADC_0 = A5;
static const byte THRUSTER_FRONT_LEFT = 3; //motor pins
static const byte THRUSTER_FRONT_RIGHT = 5;
static const byte THRUSTER_BACK_LEFT = 6;
static const byte THRUSTER_BACK_RIGHT = 9;
static const byte THRUSTER_VERTICAL_ONE = 10;
static const byte THRUSTER_VERTICAL_TWO = 11;
//Servos
Servo thrusterFrontleft
Servo thrusterFrontRight
Servo thrusterBackLeft
Servo thrusterBackRight
Servo thursterMiddleOne
Servo thrusterMiddleTwo