Skip to content
Commit 9e964d0a authored by Gerard Marull-Paretas's avatar Gerard Marull-Paretas Committed by Carles Cufí
Browse files

samples: basic: servo_motor: use pwm_dt_spec



The sample did not use PWM in a proper way: it relied on a PWM device
handle, but channel or flags were hardcoded in the code. This patch
changes the sample to use a local binding ("pwm-servo") where the `pwms`
property is defined. This allows to make use of pwm_dt_spec facilities,
reducing the overall sample complexity and making it more portable
without editing the source code. The custom binding also requires to
provide the minimum/maximum pulse width so that different servos can be
easily plugged in without the need to edit sources.

Signed-off-by: default avatarGerard Marull-Paretas <gerard.marull@nordicsemi.no>
parent cd2d867f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment