Hola que tal? Soy nuevo en el foro. Llegue aqui porque tengo en mis manos un arduino due y me encontre con un problema, al realizar el siguiente tutorial http://arduino.cc/en/Tutorial/InputPullupSerial ya sea colocando
pinMode (inPin, INPUT_PULLUP) o
pinMode (inPin, INPUT)
el pulsador se comporta igual, osea que al pulsar el led se apaga, y al dejarlo abierto, el led se enciende....quisiera saber que estoy haciendo mal, lo ideal seria que al presionar el pulsador el led encienda.....desde ya muchas gracias
Mira el pinout del DUE
Si lo conectaste al pin 2, no digo nada.
Veamos el código no dirá esto tu código?
void loop(){
//read the pushbutton value into a variable
int sensorVal = digitalRead(2);
//print out the value of the pushbutton
Serial.println(sensorVal);
// Keep in mind the pullup means the pushbutton's
// logic is inverted. It goes HIGH when it's open,
// and LOW when it's pressed. Turn on pin 13 when the
// button's pressed, and off when it's not:
if (sensorVal == LOW) {
digitalWrite(13, LOW);
}
else {
digitalWrite(13, HIGH);
}
}
Y pregunto que dice el monitor serie cuando presionas y liberas?
Lo conectaste bien? a GND y al pin 2?
