My problem is, that the sampleprogramm would detect a closed circuit, even if it isn't like this.
Even if what wasn't like what?
If the circuit is closed, it says: 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
If the circuit isn't closed, it says: 0,0,0,1,1,0,1,0,0,0,1,1,1,1,0,0,1,1,1,0,0,0,1
How can I programm the Arduino, that he only reacts in the case of a closed circuit?
Wire the circuit correctly, first. Then, reading whether the pin is HIGH or LOW is trivial.
Sorry, but how can I do this?
A plastic piece should fall out of the circuit(5V to pin 2)(simmilar to a button) and the Arduino should detect this.
Using the internal pullup resistor, and connecting a wire to a pin, to the device holding the plastic piece, and from the other side to ground, the plastic piece will prevent the connection from the pin to ground, so the pin will read HIGH. When the plastic piece falls out, and the pin to switch to ground is complete, the pin will read LOW.
Sorry, what?
I haven't worked with the Arduino very much.
I don' understand this.
Talk to me, like to an idiot.
Can you give me an example, please?