Connecting an LED to a microcontroller board port and using an internal pull-up resistor
In this section, you will learn how to connect a push button to both the Blue Pill and the Curiosity Nano boards. This is a simple exercise for these microcontroller boards, and it demonstrates how to use a push button to send a logical LOW level signal to a microcontroller board to turn an LED connected to it on or off. If we want to use a push button in our electronic circuit example, we will need to connect it to an input port from a microcontroller board. Also, remember that we should debounce our push button to avoid undesirable results.
The following subsection will show you how to debounce a push button that is connected to the Blue Pill via coding. This is the simplest way to debounce a push button and you can use this method in other chapters of this book.
Debouncing a push button via software connected to the Blue Pill
In this section, we will show you a Fritzing diagram...