change OutputPWMActive use revpimodio2

Moderator: RevPiModIO

Post Reply
yushengzhou
Posts: 7
Joined: 17 Oct 2018, 09:29

change OutputPWMActive use revpimodio2

Post by yushengzhou »

hello everyone
can I change OutputPWMActive use revpimodio2 ?
User avatar
dirk
KUNBUS
Posts: 2174
Joined: 15 Dec 2016, 13:19

Re: change OutputPWMActive use revpimodio2

Post by dirk »

Hi yushengzhou, I have moved your post to the RevPiModIO board.
User avatar
RevPiModIO
KUNBUS
Posts: 335
Joined: 20 Jan 2017, 08:44
Contact:

Re: change OutputPWMActive use revpimodio2

Post by RevPiModIO »

OutputPWMActive is a Memory (a setting for the piControl), which you have to set in piCtory!!!

If you activate the PWM for one or more outputs, you can use the outputs "PWM_1", "PWM_2" and so on to control the frequency of PWM.

Code: Select all

import revpimodio2
rpi = revpimodio2.RevPiModIO(autorefresh=True)

# Max
rpi.io.PWM_1.value = 255
# Off
rpi.io.PWM_1.value = 0
# Very low
rpi.io.PWM_1.value = 1
# Something else :D
rpi.io.PWM_1.value = 100
# And so on...
Regards, Sven
python3-RevPiModIO - https://revpimodio.org/ || Der RevPi ist das Beste, was passieren konnte!
Post Reply