Mise à jour de 'PWMDriver.py'

This commit is contained in:
Gzod01 2023-05-27 11:43:41 +02:00
parent ce5fc4c445
commit 9ef67cb37d

View file

@ -26,7 +26,6 @@ class PWMDriver:
ini_esc(LESC[1])
ini_esc(LESC[2])
ini_esc(LESC[3])
def setAngle(self, slot, angle, profileName = 'default'):
profile = None
if type(profileName) is dict:
@ -45,10 +44,8 @@ class PWMDriver:
pulse = int(self.mappyt(angle, 0, profile['range'], profile['min'], profile['max']))
#print('setting slot', slot, 'to angle', angle, 'with profile', profileName, profile, pulse)
self.driver.set_pwm(slot, 0, pulse)
def setPwm(self, slot, off, on):
#self.driver.set_pwm(slot, off, on)
self.driver.set_pwm(slot, off,on)
def mappyt(self, x, inMin, inMax, outMin, outMax):
return (x - inMin) * (outMax - outMin) / (inMax - inMin) + outMin