I have facing problem in generating 30Hz in D5 and D6 in Arduino nano at a time. The problem I am facing is, I can able to generate 30Hz at either D5 or D6.
So, I am here to ask you guys for the solution to get 30Hz at D5&D6 with 90deg phase shift between them.
I have moved your Topic to Programming Questions ....Please try not to post in Uncategorised again, If you are unsure about the categories refer to this guide or to the stickies for each category.
If you look at the pinout of the nano, pin 5 and 6 are both in PORTD (bits 5 and 6) so you have to directly manipulate PORTD. Since you want the pins to be out of phase, you will have to
read the port
set the bit you want
clear the bit you want
write the value back to the port
wait some amount of milliseconds before the next transition
Sorry, writing a code on demand is not in traditions of the forum.
You wrote. that they were able to generate the desired signal on one of the pins. Show your code - we'll tell you what needs to be fixed to generate a signal on two pins at once