Why don't you use this tutorial instead so you don't have to deal with the box locked/unlocked problem
http://playground.arduino.cc/Code/ToneAC
Why don't you use this tutorial instead so you don't have to deal with the box locked/unlocked problem
http://playground.arduino.cc/Code/ToneAC