Pulse-width modulation (PWM) can be used to generate analog-like output voltages from digital pins. PWM works by rapidly switching a pin between on and off to simulate voltages between 0V and 5V. Arduino boards have PWM-enabled pins marked with a ~ symbol that can output values from 0-255. Connecting an LED to a PWM pin with a resistor allows dimming the LED by varying the duty cycle of the on/off pulses. Pull-up and pull-down resistors are used on digital input pins to prevent floating inputs by defaulting high or low when buttons are not pressed.