Go Down

Topic: Serial monitor infinite output (Read 2 times) previous topic - next topic


hi, im having troubles regarding the serial monitor cause it shows infinite outputs of high and low

i have this simple code:

int forwardPin = 12;

void setup()
  pinMode(forwardPin, INPUT);

void loop()
  int forwardState = digitalRead(forwardPin);
  if (forwardState == HIGH)

but when i look at the serial monitor for its output, it shows infinite loops of high and low.

i also tried it for outputing Serial.write for my project, but still it doesn't work

hope u could help me. im trying this code for my robotics project so im glad if anyone here could help

thanks in advance


Jan 27, 2013, 06:36 pm Last Edit: Jan 27, 2013, 06:38 pm by AWOL Reason: 1
Second floating pin question in under 24 hours.
A new record?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.


but when i look at the serial monitor for its output, it shows infinite loops of high and low.

Does the value change from HIGH to LOW only when you press the switch? Or does it change randomly?

How is the switch wired?


thanks for the reply PaulS.

no...it shows high and low outputs randomly immediately after i turned on the serial monitor.

actually, im using a device which outputs digital signals...and it is connected in pin 12 of my arduino.
(it is an infrared device with a remote as its controller).

again, thanks for the reply. i really appreciate it.


Hi AWOL...

i read the thread that u gave with the link...so that could be the reason?

so what to do with the floating pin?

yes sir im a noob, so could u please help me? ty

Go Up