digitalRead temporal resolution ? (trigger persistance)
hi everybody,
i introduce problem little code , obtain...
the code:
the console answer:
it simple setting, connect briefly vcc pin 4, instead of having 1 (or two) ones displayed, have long serie of them, alternance of 0 , 1, , 0.
do have explananation that?
i introduce problem little code , obtain...
the code:
code: [select]
int pin_switch1 = 4;
int status_switch1 = 0;
void setup()
{
serial.begin(9600);
pinmode(pin_switch1, input);
}
void loop()
{
status_switch1 = digitalread(pin_switch1);
serial.print(status_switch1);
delay(50);
}
the console answer:
code: [select]
0000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111010101010101010101010100000000000000000000000000
it simple setting, connect briefly vcc pin 4, instead of having 1 (or two) ones displayed, have long serie of them, alternance of 0 , 1, , 0.
do have explananation that?
a floating input pin can take state, , will.
Arduino Forum > Using Arduino > Programming Questions > digitalRead temporal resolution ? (trigger persistance)
arduino
Comments
Post a Comment