I am trying to code a square wave generator that will allow me the ability to adjust the frequency and the pulse width.
Is it possible to achieve 20,000 cycles per second?
I have been using delays and analogReads to generate pulses but, I am only able to get about 1 cycle for every 2ms. If I am correct this only equates to 500 cycles per second. Is that right?
If the runs at 16Mhz, it should be able to generate a 20khz wave with ease, right?
Thank you for your help in this, I really appreciate it.