Grandissimi è venuto!!! Grazie mille!!! Siete dei grandi!!!posto il programma corretto.
#include <PS2X_lib.h> //for v1.6
#include <Servo.h>
PS2X ps2x; // create PS2 Controller Class
Servo myservo;
Servo myservo2;
int error = 0;
int pos = 90;
void setup(){
Serial.begin(57600);
//CHANGES for v1.6 HERE!!! **************PAY ATTENTION*************
error = ps2x.config_gamepad(6,10,9,11, true, true); //setup pins and settings: GamePad(clock, command, attention, data, Pressures?, Rumble?) check for error
myservo.attach(3);
}
void loop() {
ps2x.read_gamepad();
if( ps2x.Button(PSB_BLUE) && pos <= 180){
pos = pos + 10;
myservo.write(pos);
delay(100);
}
if( ps2x.Button(PSB_PINK) && pos >= 0){
pos = pos - 10;
myservo.write(pos);
delay(100);
}
delay(15);
}
Bisognava dare un valore iniziale a pos per poter fare l'operazione iniziale

.