BrainPad micropython PWM

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
duma
Posts: 4
Joined: Wed Sep 06, 2017 2:30 pm

BrainPad micropython PWM

Post by duma » Wed Sep 06, 2017 2:53 pm

Hi, everyone! I am a newer with micropython and need help now. I am using BrainPad by GHI electrinics. When I try run machine.PWM, according micropython manual it raise exception File "", line 1, in
AttributeError: 'module' object has no attribute 'PWM'. Who is familiar with that or have an idea, please, help me!

User avatar
dhylands
Posts: 3295
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: BrainPad micropython PWM

Post by dhylands » Wed Sep 06, 2017 4:21 pm

It looks like the stm machine module doesn't have PWM. Instead, you can create PWM using the pyb.Timer module.

See: https://github.com/dhylands/upy-example ... wm_test.py for an example.

I've also started to put together a board support package for the BrainPad, which you can find here:
https://github.com/dhylands/BRAINPAD

Servo 1 is connected to PA3 and Servo 2 is connected to PA0. PA0 uses channel 1 on timer 2 or 5, and PA3 uses channel 4 on timer 2 or 5.

duma
Posts: 4
Joined: Wed Sep 06, 2017 2:30 pm

Re: BrainPad micropython PWM

Post by duma » Wed Sep 06, 2017 5:12 pm

Thank you a lot! Good job! That makes my life easier :)

Post Reply