peeniewallie:
dude please read i use the pin 4 input with a pullup risistor i am not lighting a led with an output, please read
Dude please document what you do better, read the docs and answer questions you are being asked if you expect any further help.
There is no pin 4 documented anywhere in your drawing or code
How are you lighting the led ? where is the current limiting R ?
You mention a battery and a cap, (i do have a capacitor over the led, but when i disconnect the batterie to the led) ==> what is what in you drawing? It’s unclear and being asked for the 3rd time
The doc mentions
Pull-up resistors
The analog pins also have pull-up resistors, which work identically to pull-up resistors on the digital pins. They are enabled by issuing a command such as
pinMode(A0, INPUT_PULLUP); // set pull-up on analog pin 0
Be aware however that turning on a pull-up will affect the values reported by analogRead().
as well as
There are 20K pullup resistors built into the Atmega chip that can be accessed from software. These built-in pullup resistors are accessed by setting the pinMode() as INPUT_PULLUP. This effectively inverts the behavior of the INPUT mode, where HIGH means the sensor is off, and LOW means the sensor is on.
The value of this pullup depends on the microcontroller used. On most AVR-based boards, the value is guaranteed to be between 20kΩ and 50kΩ. On the Arduino Due, it is between 50kΩ and 150kΩ. For the exact value, consult the datasheet of the microcontroller on your board.
When connecting a sensor to a pin configured with INPUT_PULLUP, the other end should be connected to ground. In the case of a simple switch, this causes the pin to read HIGH when the switch is open, and LOW when the switch is pressed.
The pullup resistors provide enough current to dimly light an LED connected to a pin that has been configured as an input. If LEDs in a project seem to be working, but very dimly, this is likely what is going on.
What don’t you get from that doc?