arduino Digital Inputs

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!


  • pinMode(pin, pinMode) // Sets the pin to the mode defined.
  • digitalRead(pin); // Reads the value from a specified digital pin,


pinmodeShould be set to INPUT or INPUT_PULLUP


If the input pin is not pulled LOW or HIGH, the value will float. That is, it won't be clearly a 1 or a 0, but somewhere in between. For digital input, a pullup or pulldown resistor is a necessity.

Got any arduino Question?