Help simplifying nested code

Hi, @jimmyjohnsandwitch
Welcome to the forum.

Can you tell us how your code works, that is what is needed from the switch and GY-521 to operate the buzzer and other outputs.
A list of I/O would help, then we can advise.

Thanks.. Tom.. :smiley: :+1: :coffee: :australia: