motor test

This commit is contained in:
Bernd Reuther 2021-03-04 13:17:25 +01:00
parent 1ad0809dce
commit cafbaa1432

View File

@ -5,7 +5,7 @@ import threading
import math
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
#GPIO.setwarnings(False)
class motor:
@ -34,27 +34,19 @@ class motor:
self.pwm1 = GPIO.PWM(sp1, freq)
self.pwm1.start(0)
self.pwm1.ChangeFrequency(freq)
self.pwm1.ChangeDutyCycle(0)
self.pwm2 = GPIO.PWM(sp2, freq)
self.pwm2.start(0)
self.pwm2.ChangeFrequency(freq)
self.pwm2.ChangeDutyCycle(0)
self.pwm3 = GPIO.PWM(sp3, freq)
self.pwm3.start(0)
self.pwm3.ChangeFrequency(freq)
self.pwm3.ChangeDutyCycle(0)
if self.halten == 1:
self.pwm4 = GPIO.PWM(sp4, freq)
self.pwm4.start(0)
self.pwm4.ChangeDutyCycle(cyc_halten)
self.pwm4.start(cyc_halten)
else:
self.pwm4 = GPIO.PWM(sp4, freq)
self.pwm4.start(0)
self.pwm4.ChangeDutyCycle(0)
print(str(self.pwm4))