Does any one know how to invert a PWM signal comming out of pin 9 on to pin 10?
Below is what I have so far messing around in the .ino and the attached libraries!
Mimics the fade example but with an extra parameter for frequency. It should dim but with a flicker
because the frequency has been set low enough for the human eye to detect. This flicker is easiest to see when
the LED is moving with respect to the eye and when it is between about 20% - 60% brighness. The library
allows for a frequency range from 1Hz - 2MHz on 16 bit timers and 31Hz - 2 MHz on 8 bit timers. When
SetPinFrequency()/SetPinFrequencySafe() is called, a bool is returned which can be tested to verify the
frequency was actually changed.
This example runs on mega and uno.
//use pin 11 on the Mega instead, otherwise there is a frequency cap at 31 Hz
int led = 9; // pin 9 out put
int led2 = 10; //pin 10 output
int32_t frequency = 10000; //frequency (in Hz)
//initialize all timers except for 0, to save time keeping functions
//sets the frequency for the specified pin
bool success = SetPinFrequencySafe(led, frequency);
//if the pin frequency was set successfully, turn pin 13 on
//use this functions instead of analogWrite on 'initialized' pins