Basic maths: 10k? resistor, 5V voltage, 100µF cap=0.76 second LED fadeout

MarkT:

See the attached schematic.

You short the supply into the capacitor - add a small value resistor in series with the
switch if you want to avoid welding it shut and resetting the Arduino!

Oh, so it's not good to let caps suck in energy as they please, without controlling it? As explained f.ex. here. Hmm i guess (V=IR) if at the beginning time t0 the voltage jumps to 5V, the resistance is (theoretical) 0, then the current is infinite, until the capasitor starts to build resitance as it's charge increases. Is this it?

Thanks MarkT for bringing this to my attention!

I love these little electronics and Arduino, it's such a great way to get (back) into math and so many other wonderful things :slight_smile: