digitalRead temporal resolution ? (trigger persistance)


hi everybody,

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

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'