I understand how to fade out the LED with capacitor, but I don't seem to understand how to 'fade in' the LED. Can I also do it with capacitor or do I need to use resistor? because if I put a resistor, the led never fades in, just gets weaker. Thanks
The analog proposal is not going to work well. The cap charge is exponential, and the LED needs a high enough Vf to work. So it will still look very binary or on/off.
Better way is to do this digitally with pulse width modulation. The LED is very fast, and your eye will average the amount of time on as if it were dimming. Several ways to do this exist, discussed here. https://www.maximintegrated.com/en/app-notes/index.mvp/id/5718