user19872: I know this is ridiculously simple task but I spent the last two hours trying to get this to work and it is not working.  I don't have an Arduino but I have an ESP8266 Huzzah Feather which is programmable via the Arduino IDE.  So, I don't think I can provide a Fritz diagram but in any case, I'm just trying to hook up a pushbutton and be able to read a HIGH or LOW (via my Serial monitor).  Currently, everything is 0.
As best I can describe it is:
5V from Feather into resistor into one terminal of the pushbutton.  Out the other terminal of the pushbutton is a wire connecting to pin 12 of the Feather, and also a wire leading to ground.  Feather is also grounded.  
My code is:
void setup()
{
  Serial.begin(9600);
  pinMode(12, INPUT);
}

void loop()
{
  int button_val = digitalRead(12);
  Serial.println(button_val);
}

It shouldn't be this hard for me.  Whenever I open and run the serial monitor, it reads 0s.  What am I missing?  
Oh, an issue that I faced is determining which 2 out of the 4 terminals of the pushbutton to use.  Some resources I find say that it is the same side as the terminal the voltage is flowing into; other resources say it is the terminal opposite to the side the voltage is flowing into.  I currently have it opposite.  

user4143: 
Out the other terminal of the pushbutton is a wire connecting to pin 12 of the Feather, and also a wire leading to ground.

That sounds to me like you have connected the IO pin direct to ground.
The IO pin should connect to the same pin as the resistor that connects to +5v. The other side of the button should connect to ground only.
For instance using @HansNeve's button picture you could connect pin A to the IO pin and via a resistor to +5V, and pin B to ground.

user19322: The pins on each side of the button are shorted, the "button" is between the sides of the button. Else your code looks alright.
Edit: Here's an image which shows how a push button is connected internally, make sure you're using the correct pins.


19872: <p>I know this is ridiculously simple task but I spent the last two hours trying to get this to work and it is not working.  I don't have an Arduino but I have an ESP8266 Huzzah Feather which is programmable via the Arduino IDE.  So, I don't think I can provide a Fritz diagram but in any case, I'm just trying to hook up a pushbutton and be able to read a HIGH or LOW (via my Serial monitor).  Currently, everything is 0.</p>

<p>As best I can describe it is:</p>

<p>5V from Feather into resistor into one terminal of the pushbutton.  Out the other terminal of the pushbutton is a wire connecting to pin 12 of the Feather, and also a wire leading to ground.  Feather is also grounded.  </p>

<p>My code is:</p>

<pre class="lang-c prettyprint-override"><code>void setup()
{
  Serial.begin(9600);
  pinMode(12, INPUT);
}

void loop()
{
  int button_val = digitalRead(12);
  Serial.println(button_val);
}
</code></pre>

<p>It shouldn't be this hard for me.  Whenever I open and run the serial monitor, it reads 0s.  What am I missing?  </p>

<p>Oh, an issue that I faced is determining which 2 out of the 4 terminals of the pushbutton to use.  Some resources I find say that it is the same side as the terminal the voltage is flowing into; other resources say it is the terminal opposite to the side the voltage is flowing into.  I currently have it opposite.  </p>
 4143: <blockquote>
  <p>Out the other terminal of the pushbutton is a wire connecting to pin 12 of the Feather, and also a wire leading to ground.</p>
</blockquote>

<p>That sounds to me like you have connected the IO pin direct to ground.</p>

<p>The IO pin should connect to the same pin as the resistor that connects to +5v. The other side of the button should connect to ground only.</p>

<p>For instance using @HansNeve's button picture you could connect pin A to the IO pin and via a resistor to +5V, and pin B to ground.</p>
 19322: <p>The pins on each side of the button are shorted, the "button" is between the <em>sides</em> of the button. Else your code looks alright.</p>

<p>Edit: Here's an image which shows how a push button is connected internally, make sure you're using the correct pins.</p>

<p><a href="https://i.stack.imgur.com/vJ3ZH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vJ3ZH.png" alt="enter image description here"></a></p>
