This is a cache of https://discuss.96boards.org/t/pwm-on-dragonboard/8344. It is a snapshot of the page at 2024-10-31T11:30:42.252+0000.
PWM on <strong>dragonboard</strong> - <strong>dragonboard</strong>410c - 96Boards Forum

PWM on dragonboard

Hi team,

I have some problems using the libmraa library for pwm(I want to control my led), when a run my script it says that the pwm is not initialized correctly.

As I was searching for a solution, I learned that only the Pin 28 MPP4 in the LS header is capable of producing the PWM output.

This is the code I used:
import mraa
import time

initialise PWM

x = mraa.Pwm(28)

set PWM period

x.period_us(700)

enable PWM

x.enable(True)

value= 0.0

while True:
# write PWM value
x.write(value)

time.sleep(0.05)

value = value + 0.01
if value >= 1:
    value = 0.0

I am using the latest version of debian, retrieved from Debian Downloads for dragonboard-410c - 96Boards

I am looking forward for a response.
Thanks.

Hi @tarmac,

Sadly, PWM is not supported for dragonboard410c in MRAA currently. But, I’ll add it in couple of days since you’ve requested. Essentially, we would need to set up the pin capabilities and chip/pin info in board file.

Thanks,
Mani