Formula & method
R = (Vsupply − Vf × count) / I; Presistor = I²R
Worked example
12 V supply, 2 V LED, 20 mA → 500 Ω
Assumptions & safety boundary
Mathematical estimate only. Verify equipment datasheets, manufacturer instructions, electrical codes and qualified design before real-world use.