# Setting 2 pins at each others inverse

Hi guys, I'm new in the Arduino-world and building my first Arduino-powered gadget. I built a diy-variometer from this page: http://forum.skynomad.net/viewtopic.php?f=14&t=8333 I finished it and everything works fine. Well almost everything ;) There are two little issues:

1) The variometer sometimes beeps while laying on the table (constant altitude). I just used the Code from the link above. Hardware is also the same, connections are the same, too. Can you find the line, where this problem is located? :)

2) This is the bigger problem: I used the piezo like it's shown at the link; connected to GND and pin9. I'd like to have a louder beep from the piezo so I thought of another setup: Would it be possible to connect the piezo to the ports 8 and 9 (for example) and inverse those pins (pin8 HIGH when pin9 is LOW, pin8 LOW when pin8 is HIGH). The idea is, to create a bigger voltage (max voltage at pin9-GND is 3.3V, with 2 pins it would be 6.6V, wouldn't it?). How can I make the two pins swap continuously? I got a few programming-skills on C, but I don't know, how to set this continuing mode...(it also would be nice to know the negation-sign on Arduino).

Thanks for your help guys! Best regards

Would it be possible to connect the piezo to the ports 8 and 9 (for example) and inverse those pins (pin8 HIGH when pin9 is LOW, pin8 LOW when pin8 is HIGH).

Yes

.

The idea is, to create a bigger voltage (max voltage at pin9-GND is 3.3V, with 2 pins it would be 6.6V, wouldn't it?).

Pin 8 at 3.3V, pin 9 at Gnd = 3.3V. Pin 8 at Gnd, pin 9 at 3.3V = 3.3V.

Not going to get 6.6V.

I think the theory is if you have pin 8 to one side of the piezo, and pin 9 to the other, then pin 8 would deflect it one direction (the negative) and pin 9 in the other (the positive). So, in essence, twice the deflection.

Not actually doubling the voltage.

Thanks for your support! @LarryD: Thank you very much! This is exactly, what I was searching for :)

@evanmars: yeah, that was my thought, except, I thought it would double the voltage...

I just tried it now and it works fine! Not exactly the doubled loudness, but good enough :)