Computing resistor value for LED