Calculate the correct resistor value for an LED circuit given supply voltage, LED forward voltage, and current.
When powering an LED, a current-limiting resistor is essential to prevent burnout. The formula is R = (Vs - Vf) / I, where Vs is supply voltage, Vf is the LED forward voltage, and I is the desired current (typically 20mA for standard LEDs).