Does anyone know if it's possible to run PWM on two Arduino pins so that they have the exact opposite phase?
Essentially, I'm looking to switch both sides of a coil on and off using the outputs of the arduino (with a ULN2003 driving the load). The idea is that I can set the outputs to 01 then 10, and back to 01 at different frequencies and/or duty cycles. This will energise the coil in opposite directions, generating a magnetic field.
So my problem is that I need to oscillate one pin of the Arduino, but oscillate another with the exact opposite phase. Any ideas how I can do this?
So far, the best I have is a loop of digitalWrite()s that set the two pins on/off appropriately. Obviously, not very good, and better done with PWM, I'm sure.