I am trying to program a UNO to control a robot to move forward and back using a ps2 with joystick. I want to control the speed by moving the js on x-axis and direction by moving js on y axis. The foll. code works but without js controls. Now want to include js controls. Any help appreciated.
Moderatots note : please use code tags for pieces of code
C:
/<
void setup() {
//Setup Channel A
pinMode(12, OUTPUT); //Initiates Motor Channel A pin
//Setup Channel B
pinMode(13, OUTPUT); //Initiates Motor Channel B pin
}
void loop(){
//Motor A forward @ full speed
digitalWrite(12, LOW); //Establishes backward direction of Channel A
analogWrite(3, 255); //Spins the motor on Channel A at half speed
//Motor B forward @ full speed
digitalWrite(13, HIGH); //Establishes forward direction of Channel B
analogWrite(11, 255); //Spins the motor on Channel B at full speed
delay(1000);} >/