Questions on projects 02

Hi,

  1. I don't know the arduino project book, but, basically, the 220 Ohm resistor is there to limit the current and thus protect the Led and the arduino output .
    The current in the Led will be : I = (5V - V led) / 220
    Vled depends on the led (for a Red led, it is about 1,9V )
    If you replace the resistor with a wire, you'll likely fry the Led and maybe the arduino output too

  2. If one side of the pushbutton is connected to 5V and the other side to the input, yes, the input will be HIGH when the button is pressed, but the arduino inputs are high impedance inputs. Their state is undetermined when the are not connected to anything. Then if the button is released, the input is in an undetermined state .
    That is why you need a pulldown resistor between the input and 0V , so that the input is LOW when the button is not pressed.