[ we make science jokes, periodically ]

Measuring Analog and Digital Signals

Analog and digital are two ways to talk about how voltage is used and measured by a microprocessor. Let's go over them.

On/Off
Digital is straightforward. Think of it as on and off. When the voltage measures 0, it is off or sometimes called low. When it measures 3 volts, it is on or sometimes called high.

Digital Signals
We can use a digital signal for things like pressing a button. If it is pressed, it is high. If it isn't pressed, it is low.

Analog Signals
Analog splits three volts into smaller parts. For example, a micro:bit splits voltage into 1023 small parts. If the voltage is very low, it might measure 50. If it is three volts, as high as it can be, it will measure 1023.

Analog Sensors vs Digital Sensors
An analog light sensor might measure 50 in low light, 500 when a light turns on, and 1023 in sunlight. With a digital sensor, it will only tell you if there is or isn't light.