Section 2.4 Day 3x In-Class: Observing and Fixing Bounce
On Tuesday we made our first oscilloscope measurements with the AD2 and Waveforms, and we wired a pushbutton to a pin of the STM32C031C6. Today we’ll go back to the oscilloscope and look more closely at switches and inputs. We’ll put the scope on the button itself and see what actually happens on the pin when a finger presses it, and then we’ll fix the switch bounce in hardware, by putting a capacitor across the switch. After that we’ll discuss ways to write the toggleLED program: polling gives you the button’s level when what a toggle needs is the moment it changes, so we’ll detect the edge instead.
