I'm looking for a simple replacement for this code that is not really doing the job right.
I have got an output pin being toggled using .........................
Thread.Sleep(3);
clk = !clk;
You can see that the output named clk turns on and off dependent on how long it takes for the rest of the program to cycle through 3 times.
I would like it to toggle every 2.38ms (420hz) regardless of the rest of the program.
Is there simple solution to this?
P.S My knowledge of programming is strictly beginner.