Lite / Building Machines That Respond / Week 20
Week 20: Inputs and outputs
This week you will
- Configure a pin as an input or output and predict its voltage level.
- Size an LED resistor and a pull-up resistor with Ohm's law.
- Explain why a button needs a pull-up resistor and how debouncing works.
Lessons
- Pins: high, low and in between · about 30 min
One tiny metal leg on a chip can light an LED, read a button or wreck itself. What decides which? - Pull-ups: giving a button a resting voltage · about 30 min
A button only connects two wires. So why does every microcontroller button also need a resistor? - Debouncing: one press, one count · about 30 min
You press a button once. Your program counts seven presses. Is the code wrong, or is the button lying?