int cont=0; bool p1, p2; void setup(){ pinMode(13, OUTPUT); // destra pinMode(12, OUTPUT); // sinistra pinMode(2, INPUT_PULLUP); // destra pinMode(9, INPUT_PULLUP); // sinistra Serial.begin(9600); } void loop(){ p1=digitalRead(9); //sinistra p2=digitalRead(2); //destra digitalWrite(12, p1); //sinistra digitalWrite(13, !p2); //destra } |