int lectura=0; void setup() { // put your setup code here, to run once: pinMode(6, INPUT); Serial.begin(9600); } void loop() { // put your main code here, to run repeatedly: lectura=digitalRead(6); delay(20); Serial.println(lectura); }