I am using an arduino Lilypad Simplesnap with atmega328p. I need a PWM on pin 5. I use the timer 0 to generate it and it works great. However, I am supposed to use pin 6 as a digital OUTPUT to enable and disable a device.
The problem is that Pins 5 and 6 are BOTH controlled by Timer 0. Therefore the PWM of pin 5 influences the behavior of pin 6.
How can I make pin 5 generate a PWM and pin 6 just be a digital OUTPUT?
I attached two picture of the behavior of pin 6 with and without PWM on pin 5.
Thanks in advance.