Hi,
So you are counting in binary 6 down to 1 inclusive.
In your code you need to setup a counter that starts at 6, counts down and when it gets to 1 the next count is a roll back to 6.
You then using the counter value;
Read bit(2) ,the MSD, and output it to a designated output.
Read bit(1) and output it to a designated output.
Read bit(0) ,the LSD, and output it to a designated output.
If you put a potentiometer on an analog input of the controller, you can read the voltage from it and compute that into a speed to run the counter and up date the outputs.
I hope this helps.
Tom.. ![]()