How do I know what resistor to use??

Okay, NoObisch Q,

I wonder how I would know how many Ohm a resistor should be, when I am designing a circuit on my own.

Like the KnightRider example, they use 220 Ohm, why (and why use a resistor here anyway??)

I am also using Google offcours, but here I have a feeling I can ask stuff I don't get.
(I have a medical background, doing electronics as a hobby).

Thnx for the time and Greetz from the Netherlands!!

it's basically ohms law. all the time :wink:
you need the 220 ohm in this case, because an LED equals a very low resistance as long as it is conductive. and the law of mister ohm says: amperage = voltage / resistance. the voltage on our digitaloutput is 5Volt, the resistance is very little, so we get a huge amperage. our microcontroller digital output is designed to offer ~20mA. it will may get destroyed when an amperage larger than that flows through it. so we use a 220ohm resistance to force an amperage below 20mA.