Capacitors are also typically used in timers. Research monostable and astable 555 timers (the difference between them has to do with whether or not the input is external but I don't remember which is external input and which is internal input). You will find that the frequency and period entirely depends on the times it takes for the capacitor(s) to charge and discharge.
I also started writing this to simulate a 555timer, but I'm kicking myself now for not finishing it (it was supposed to be for a neural network simulation where decisions are based on how hard each capacitor pushes back current, and the neural network is trained by adjusting values on the capacitors)
RS FLIP FLOP TRUTH TABLE
float VoltRegion1; //Potential between resistor 1 and 2, given by Voltage - (Voltage/3)
float VoltRegion2; //Potential between resistor 2 and 3, given by Voltage - (2/3)Voltage
float Capacitance; //In a real application this is usually in microfarads
//These will often be the same