As a beginner, I would like to write a simple code to toggle digital output on two Arduino DUO pins (#5 and 6 in this case). What I want to output should be something like
- Each cycle is 10ms
- In each even number cycle, pin 5 is set ON while pin 6 is set OFF, for only 3ms. After that both are set to OFF
- In each odd number cycle, pin 6 is set ON while pin 5 is set OFF, for only 3ms. After that both are set to OFF
Running with the attached code, however, I could see something like a sine wave output from both pins with logic analyzer, as seen on the attached snapshot. And the frequency is way to high.
I would like to hear how to fix that piece of code.
Test_Pin_Output.ino (2.88 KB)