I'm trying to debug another project, that has a similar problem to this. I would take it step by step to see what was wrong and started with this.
It's just a simple program that tries to read digital input. The problem is that no matter if I set the wire in or out it's wobbling between low and high. Its mostly staying at high. The only thing it can see is when the wire is in. Then its high no matter what...
This is confusing.. Please help
Regards Rumrobot
int input;
void setup()
{
 Serial.begin(9600);
 pinMode(4, OUTPUT);
 pinMode(3, INPUT);
}
void loop()
{
 digitalWrite(4, HIGH);
 input = digitalRead(3);
 if (input == HIGH)
 {
  Serial.println("HIGH");
 }
Â
 if (input == LOW)
 {
  Serial.println("LOW");
 }
}
(The wire isn't in on the picture. And if I fiddle with the Arduino when the wire isn't in, it starts wobbling between high and low again.)