Why resistors in simple projects?

Numerous beginning projects in "Getting Started with Arduino" have resistors, for example, in parallel after a button or photoresistor. What is the purpose of the resistor; please don't just say a pull-up or pull-down resistor (if that's the case), since I don't know what those are? Thanks...

Although it may not fully answer your question, the Arduino tutorial for digital pins is good place to start: http://www.arduino.cc/en/Tutorial/DigitalPins

Also, you have two threads on this topic, can you delete one (or at least mark one as dead) so you don't get different people answering the same question in two different places

What the point of a resistor ?

To limit current !!!!

If a pin is not connected to Gnd and positive supply it is said to be floating , eg as no direction , it can be any logic state and is unpredictable.

So you use a resistor to force it to one state or the other, But you can still force it to the other state because it is only weakly held.

Some more comments:

a digital input pin has not a definite value of 0 or 1 (as peter247 said).
So you use a pull up resistor to pull the input level up to Vcc (and read a "1") or a pull down resistor to pull the level of the input pin down to GND (and read a "0".
If you use a pull up, connect the switch from the digital input to GND. If you press the switch, the digital input is connected to GND and you read a "0" at the input pin until you release the switch.
With a pull down resistor, the switch is connected to Vcc. If you press the switch, the input is connected to Vcc and you read a logical "1" as long as the switch is pressed.

Mike

Thank you, Mike, peter247 and mem, and Andy at the redundant posting of this question (oops). Arduino is my first foray into digital (obviously) and I have many elementary principles to learn. Thank you for getting me started.

Please excuse the double posting of this question; it resulted from a browser error that left me wondering if the initial post actually happened.

Please post any further responses to the other posting, same Subject question.

NoisyBits

“a digital input pin has not a definite value of 0 or 1”

Sorry it's binary one or zero-s only, if it wasn't it would be analogue

o.k. , you use a pull down resistor and pull the pin up with a switch or use a pull up resistor and pull the pin down with the switch .

It all boils down to the logic of the circuit , if you was making a burglar alarm and you wished the pin to be high ( 1 ) when a loop wire was cut then pull up would be better, But the truth is who cares because it's a micro controller and you just change the logic in the program.

Peter