Generating square wave AC

So I was looking into producing square wave AC using the Arduino. My initial thought was to simply use an inverter on one output and use a switch to control which output is active at a time, but I run into trouble connecting it to ground: I'm suddenly not sure a negative current going into the Arduino's ground is possible without frying something.

Is there any way of doing this?

Thanks

Do you want a true AC wave. If so then you want a h-bridge, the sort you use for driving motors.

Ohh, that's clever. Thank you.

Yeah, I've done it with an H-bridge myself. Was trying to ring an old telephone bell with a 20hz AC signal. Never got it to work, but it sure wigged out my monitor while it was on! And it was an LCD monitor, so I totally didn't expect that.

Was trying to ring an old telephone bell with a 20hz AC signal

You need about 40V to do that.