Put one wire of the switch in S and one in +. Then put the leads of the resistor in S and -
You can use anything from a 100 ohm to a 50K ohm resistor (ask Mr. B for those)
This GIF shows the simplest possible button. When pressed, the sensor goes from a value of 0 to a value of 100 (or close to it). The light then goes from red to green.
The code to make this work is on the left. Note this is for the Hummingbird Duo. The code for the Hummingbird Bit is below.
The sensor with the HB Bit is the last block in Hummingbird and is just labeled "Hummingbird" with a drop-down. Pick "other" when you use the block with a button.