Write a driver for dimming an LED using a microcontroller.
Implement dim_led(start, target, max_step, resolution) to return the PWM compare-register values needed to move from start brightness to target brightness. Include the target value, change by no more than max_step between consecutive values, and move monotonically toward the target.
Inputs are integers. Brightness values must be in [0, resolution], and max_step must be positive. Return a list of integers, including the final target value.
def dim_led(start, target, max_step, resolution):