kopia lustrzana https://github.com/GuyCarver/MicroPython
fixed pwm use when switching to lower case.
rodzic
d21bc48162
commit
e5c70b2b29
|
@ -1,6 +1,6 @@
|
||||||
#Driver for the l298n Dual HBridge motor controller.
|
#Driver for the l298n Dual HBridge motor controller.
|
||||||
|
|
||||||
from PWM import PWM
|
from pwm import pwm
|
||||||
from pyb import Pin, delay
|
from pyb import Pin, delay
|
||||||
|
|
||||||
class motor( ):
|
class motor( ):
|
||||||
|
@ -16,7 +16,7 @@ class motor( ):
|
||||||
m2 = motor('Y5', 'Y6', ('Y4', 4)) """
|
m2 = motor('Y5', 'Y6', ('Y4', 4)) """
|
||||||
self._forward = Pin(forward, Pin.OUT_PP)
|
self._forward = Pin(forward, Pin.OUT_PP)
|
||||||
self._backward = Pin(backward, Pin.OUT_PP)
|
self._backward = Pin(backward, Pin.OUT_PP)
|
||||||
self._speedControl = PWM(speed[0], speed[1])
|
self._speedControl = pwm(speed[0], speed[1])
|
||||||
self._speed = 0
|
self._speed = 0
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -36,7 +36,7 @@ class pwm(object):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def timerandchannel( pinname, timernum ) :
|
def timerandchannel( pinname, timernum ) :
|
||||||
try:
|
try:
|
||||||
a = PWM.PinChannels[pinname]
|
a = pwm.PinChannels[pinname]
|
||||||
if timernum <= 0:
|
if timernum <= 0:
|
||||||
return a[0]
|
return a[0]
|
||||||
else:
|
else:
|
||||||
|
|
Ładowanie…
Reference in New Issue