When I did the Physical Computing Review Questions 2 this week, I tried connecting the circuit myself and control it with the program I wrote.

Untitled

I was supposed to light up the LED while pressing the button, but I got an inverse result. The light was always on, and when I pressed the button, it turned off.

PC_Week3_1.mp4

At first I thought it might be related to the resistor. Maybe the resistance was not big enough, so I added another resistor after the pushbutton, but it didn’t work. So I thought maybe I installed the button backwards, so I rotated it 90 degrees. However, the led wouldn’t be turned on either way this time.

So I drew a schematic to see what’s going on. And I compared it with the one I drew for the first two questions.

Pcomp_Week3_2.jpg

The left one is drew to answer the 2nd question; the right one is drew according to my circuit. Then I saw that the only difference between these two is the position of the switch and the wire that connected the switch and D2. So I changed my circuit according to the 1st schematic, problem solved!

PC_Week3_2.mp4

So I guess when I plugged the wire before the button, the voltage there was always high when the button was not pressed. And when it was, the voltage turned low with the connection of the resistor behind, since the current won’t change in a series circuit, the voltage decreases when the resistance increases.