Input Pull-up not working properly

I am working on my sketch and facing another problem.

My code is using 10 inputs in total from digital pin 3-12. All of them are set to pinMode INPUT_PULLUP and connected to external buttons on a gaming controller. All of them provide 1.8V, so with pinMode INPUT_PULLUP the state is 1 when not pressed. When one of them is pressed the voltage does down to 0V and inputState 0, which is exactly what I want.

The only problem now is, that 2 of the 10 inputs are always 0, even when not pressed. Something with the internal pull-up is not working. I could use analogRead, but I am wondering the 2 inputs are behaving different then the others, although they provide same voltage when pressed and when not pressed.

I am thankful for any answer.

Have a great day

Do you mean that the output from your buttons is 1.8V when not connected to anything?

I suggest you disconnect your button and measure the input pin at the processor board.

More details please

  • Which board are you using ?
  • Please post a schematic of your project. A photo of a hand drawn circuit is good enough but a photo of your project probably isn't
  • Does the problem stay with the same button or the same pin if you swap them around ?
  • what is the relevance of the 1.8V and where are you measuring it ?
  • please post a small but complete sketch that illustrates the problem, using code tags when you do

Yes exactly and even when connected to my arduino they have like 1.8-2.1V

You were lucky that you got 8 to work but connecting your gaming controller to a pull-up may damage your controller and/or arduino.
You will need to connect all your buttons to analog inputs and check to see if the voltage is greater or less than 0.9V

I am using atmega 328p au controller, that has only 6 analog pins (A0-A5). But I have 12 inputs in total.

But I forgot to mention the controller ground is connected to ground of the arduino.

When I am at home I will draw schematic