Compare a microcontroller with a single-board computer by real-time behavior, operating system, boot time, power, I/O and computing workload.
Understand the difference between a bare photoresistor and an LDR module, build the divider, read A0, and calibrate a stable switching threshold.
Trigger the HC-SR04, measure echo time, and calculate distance with a timeout, while accounting for target angle, surface and air temperature.
Compare Uno, Nano, Mega, Leonardo, Pro Mini and LilyPad by MCU, I/O count, memory, voltage, size and programming requirements.