Questions on projects 02

alnath:
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

I appreciate the quick reply!
I attached a picture of the Arduino in project 02.
I understood what you explained, thank you! but in the picture, the resistors are connecting the LEDs to GND not a power source. Based on what you said, the resistors here are limiting the current that is going to ground. I don't understand why we need resistors here when the current is going to ground anyway.

alnath:
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.

well explained! thank you

8100201203_5e816025b7_b.jpg