PWM on any pin

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
Posts: 164
Joined: Tue Nov 07, 2017 11:45 pm

PWM on any pin

Post by rhubarbdog » Fri Sep 07, 2018 2:06 am

I'm following the example <a href=" ... ">here.</a> it all works well.
When i try to move it to new pin say X8 i run into problems.
I change timer to one on pin X8 but the channel on some is indicated as 1N, how do i present this identifier to ? which takes a (positive?) integer as it's first argument.
changing the first couple of lines to read
tim = pyb.Timer(8, freq = 100)
tchannel =, pyb.Timer.PWM,
pin=pyb.Pin.board.X8, pulse_width = 0)
results in a flashing LED at about 1-2Hz, which i know isn't good as it should be channel 1N

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

Re: PWM on any pin

Post by dhylands » Fri Sep 07, 2018 5:03 am

Channel 1N is channel 1, but the output is a negated version of channel 1.

Post Reply