Have another look this page all the way down
http://www.picproje.org/index.php?topic=45268.0It shows you how to wind the transformer for achieving this application then apply the coding that you would in a pic micro to atmel cpu or in your case what you call the arduino Its All roughly the same thing
So you want pwm out one channel driving one of the fets and inverted on the other output driving the other Fet for a signal frequencey of 42khz to 47khz depending on what ever your piezo element is rated at
Lets see how you would work this out
If you know your instruction time then one port will be high for x cycles instruction time and the other port pin will be low during that period
To complete one cycle the you would have to use period = 1/f which is 1/ 42000
So lets see period for 42khz is 23.81us which constitutes one cycle 11.9 us On 11.9us OFF
You would use possibly a timer interupt and then invert the state of the ports every 11.9us
Preloading the timer with a value so that every 11.9us it overflows and calls the on interrupt routine
The on interrupt routine would simply alter the state of the ports ie if Invert port pin state ie low to high or high to low
i.e Port.pin = NOT (port.pin ) // invert state
C syntax would be something like this
Inside your interrupt call back
PORTD = PORTD ^ B00100100; // invert bit 5 , 3 (digital pin 5, digital pin 4), leave others untouched
Or not having worked with ardiuno reading through it appears you may do this
ISR(TIMER1_COMPA_vect)
{
digitalWrite(PORTPINA, !digitalRead(PORTPINA));
digitalWrite(PORTPINB, !digitalRead(PORTPINB));
}
Thats how I would approach this Then if you need to check your output with a simulator or a Scope
You would have to alter the value in the timer to account for other instyruction times to get far greater accuracy on your final frequency out
See here for more info on timers Arduino
http://www.engblaze.com/microcontroller-tutorial-avr-and-arduino-timer-interrupts/Far better explanation of this here
http://www.hobbytronics.co.uk/arduino-timer-interruptsThe answer here lies in your understanding of instuction time which is also determined by your cpu clock frequency