There are numerous examples of how to connect button switches via an external interrupt. This example offers an alternative approach.
A totally flexible and general timer interrupt framework for designing solutions needing one or many individual elapsing and separate timers
Switches can be troublesome! This library for controlling different types of switch and switch circuits can remove much of the hassle.
I have used a 1.kk flight controller along with an Arduino Nano and an ultrasonic sensor to add the feature of altitude hold.
Use a single interrupt to easily and simply process any number of switches, button or toggle and wired in any scheme.
This is a traffic light with a treadmill and a sensor that detects if someone still crossing the road.