I have the following script to test the pwm funcion of the Jetson.GPIO library, but i cant make it work. I already tested my circuit/connections in a arduino so i know that the problem is with the jetson.
here is my script:
import RPi.GPIO as GPIO
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
# Motor
GPIO.setup(18, GPIO.OUT, initial=GPIO.LOW) # IN1
GPIO.setup(17, GPIO.OUT, initial=GPIO.LOW) # IN2
GPIO.setup(13, GPIO.OUT) #PWM port
GPIO.output(18, GPIO.HIGH) # M1 in1
GPIO.output(17, GPIO.LOW) # M1 in2
#pwm jetson ports = gpio12, =gpio13
M1=GPIO.PWM(13, 50)
M1.start(25)
while True:
r=input()
if(r=="s"):
M1.ChangeDutyCycle(0)
if(r=="m"):
M1.ChangeDutyCycle(50)
if(r=="f"):
M1.ChangeDutyCycle(100)
if(r=="h"):
GPIO.output(18, GPIO.LOW) # M1 in1
GPIO.output(17, GPIO.LOW) # M1 in2
GPIO.cleanup()
break
i know that the pin 33 on BOARD configuration is port gpio13 on BCM configuration and that it is a PWM capable since it is the pin used in the samples of the Jetson.GPIO library on github, and i think that pin 32 (gpio13 on BCM) is also PWM capable. what am i doing wrong?