void setup() { Serial.begin (9600); pinMode(2,INPUT); // Echo a pin2 pinMode(3,OUTPUT); // Trigger pin3 pinMode(4,INPUT); //infrarrojo delantero pinMode(5,INPUT); //infrarrojo trasero //////////////////////////////////////////////// delay(4000); // Espero 5 segundos MI.attach(9); MD.attach(10); while( !digitalRead(5)){ // Mientras el MI.write(180); //sensor trasero MD.write(0); // no detecte negro } //PARAR SERVOS //AVANZAR HACIA EL CENTRO 2 SEGUNDOS ///////////////////////////////////////////////////// }