Alguien me puede ayudar a buscar el error en el código por favor

Cuando meto el código al arduino en seguida se me enciende la alarma y no tengo idea donde esta el problema.
La función de este código es detectar sismos con un péndulo pero parece que el péndulo con envía nada y la bocina se activa sola.
: o :frowning:

You did not post the code.

Post a schematic of the wiring too.

If the pendulum sensor is one that makes contact when shaken, is the wire you're reading connected to anything other than the input pin when it's not making contact? If so, you need a pullup or pulldown, otherwise it is a "floating" input, and will read a random value when not connected (read about that in your language and see if it applies)