SHOW:
|
|
- or go back to the newest paste.
1 | #!/usr/bin/python3 | |
2 | ||
3 | - | # Use for PWM on /dev/bone/pwm/ |
3 | + | from sysfs_pwm import Pwm # https://pastebin.com/R70P1wAn |
4 | ||
5 | - | from pathlib import Path |
5 | + | # initialize and enable pwm, automatically disable when scope is left |
6 | - | from NewMotor_TB6600 import Pwm # see https://pastebin.com/R70P1wAn |
6 | + | with Pwm('/dev/bone/pwm/1/a', frequency=20000, value=0) as pwm: |
7 | - | from time import sleep |
7 | + | while True: |
8 | pwm.value = float(input("Enter PWM value (between 0.0 and 1.0): ")) | |
9 | - | GPIO = Path('/sys/class/gpio/gpio60/direction') |
9 | + |