Question about Spaceship Interface project

Hi, I'm completely new to electronics and I just finished the 2nd project of the Arduino Projects book. I was able to complete it successfully but I still got a coupple doubts...

  1. For the button there is a 10k ohm resistor being used, but then for the LEDs we use a 220 ohm resistor. My question is, why do we need a 10k one for the button? ... I understand a resistor is needed to connect to ground when switch is open, .. but, why 10k and not 220 ?.. :~

  2. Also, I noticed that for this proejcts the ohm resistors were placed in the ground, but then in the previous they were in the positive. Does it make a diference where they're placed?

If anybody could help me figure this out, Thanks!

220 would work for the switch, but 10K is used because very little current needs to flow into the digital pin and 10K will allow enough current. If 220 ohm were used almost 50 times the current flows. That much current is not required and is inefficient as heck. On he other hand the LED requires the current that the 220 ohm resistor allows.

groundfungus:
220 would work for the switch, but 10K is used because very little current needs to flow into the digital pin and 10K will allow enough current. If 220 ohm were used almost 50 times the current flows. That much current is not required and is inefficient as heck. On he other hand the LED requires the current that the 220 ohm resistor allows.

Hi!, thanks groundfungus!

groundfungus:
220 would work for the switch, but 10K is used because very little current needs to flow into the digital pin and 10K will allow enough current. If 220 ohm were used almost 50 times the current flows. That much current is not required and is inefficient as heck. On he other hand the LED requires the current that the 220 ohm resistor allows.

It is still not clear for me.
You are telling that pin needs a little current that is possible with this resistor, but pin does not need any current when it reads the LOW value, all the current goes to the GND. Only when switch is closed, current goes to the pin. It has two ways where to go, and it goes to the pin instead of GND, qoz pin's own resistance is less than 10k ohm, so it reads HIGH, when current goes into it.

And as I understand, we need any resistor to connect pin and GND with only one condition, that resistor's resistance should be higher than pin's own resistance.
Can anyone confirm it, or maybe I am wrong?