Question about serial


hello,

i have question serial communication, or digitalread.

code: [select]

 
int input8 = 8;

void setup(){
 
serial.begin(9600);


pinmode(input8, input);


}


void loop(){
  int i8a = digitalread(input8);

  serial.println(i8a);

  delay(10);
}


whenever apply power input 8 in serial monitor shows it, when take out sticks around few seconds. not happen when apply power it, when take away power.
i grateful if me.

                                                                      - manofpanda

dc have pull down resistor between pin , ground.  if not digital pin "floating" when disconnected , state undefined.  have dfininate state pin must connected either +v or ground.  resistor can 1k 10k.


Arduino Forum > Using Arduino > Project Guidance > Question about serial


arduino

Comments

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

How to format a Get Request

avrdude: verification error, first mismatch at byte 0x0000 0x0c != 0x62