What's the purpose of the resistor in this circuit?
tocomment: I understand what circuits do a lot of times but I never understood why there's always a resistor even on simple circuits.  And how do you decide when to use one, how do you know what resistance to use when designing a circuit?This really simple circuit illustrates my confusion.