Hi, I use t200 thruster with basic esc and I want to control thuster with raspberry pi. Howewer I couldn’t find a sample code.
I try this code:
import RPi.GPIO as GPIO from time import sleep GPIO.setmode(GPIO.BCM) GPIO.setup(18,GPIO.OUT) motor=GPIO.PWM(18,100) motor.start(0) # GPIO.setwarnings(False) try: for i in range(100): print(i) motor.ChangeDutyCycle(i) sleep(0.5) except KeyboardInterrupt: print("Motor kapatılıyor... (Ctrl+C ile çıkış yapıldı.)") finally: GPIO.cleanup()
However I did not get a stable result. As far as I can tell, 12-20 runs in the backward direction and 60-70 in the forward direction. This made no sense to me.
Do you have a sample code for me? I’ll be happy if you can help me.