def __init__(self, pins, name='', verbose=False): self.__name__ = name self.__verbose__ = verbose if self.__verbose__: print('Initializing UltraServo', self.__name__, '...', end=' ') self.__pins__ = General.LoadPins(['serv', 'trig', 'echo'], pins) self.__ultraservosetup__() if self.__verbose__: print('Done')
def __init__(self,pins,pud='OFF',name='',verbose=False): self.__name__ = name self.__verbose__ = verbose if self.__verbose__: print('Initializing InPin',self.__name__,'...',end=' ') self.__pins__ = General.LoadPins(['in'],pins) self.__inpinsetup__(pud) if self.__verbose__: print('Done')
def __init__(self, pins, freq=1023, dutycycle=100, on=False, name='', verbose=False): self.__name__ = name self.__verbose__ = verbose if self.__verbose__: print('Initializing PWMPin',self.__name__,'...',end=' ') self.__pins__ = General.LoadPins(['out'],pins) self.__pwmpinsetup__(on,freq,dutycycle) if self.__verbose__: print('Done')
def __init__(self,pins={},name='',verbose=False): self.__name__ = name self.__verbose__ = verbose if self.__verbose__: print('Initializing OutPin',self.__name__,'...',end=' ') self.__pins__ = General.LoadPins(['out'],pins) self.__outpinsetup__() if self.__verbose__: print('Done')
def __init__(self, pins, name='', verbose=False): self.__name__ = name self.__verbose__ = verbose if self.__verbose__: print('Initializing Ultrasonic Sensor',self.__name__,'...',end=' ') self.__pins__ = General.LoadPins(['trig','echo'],pins) self.__ultrasonicsensorsetup__() time.sleep(2) if self.__verbose__: print('Done')
def __init__(self, pins, name='', verbose=False) -> None: self.__name__ = name self.__verbose__ = verbose if self.__verbose__: print('Initializing Servo', self.__name__, '...', end=' ') self.__pins__ = General.LoadPins(['serv'], pins) self.__servosetup__() time.sleep(2) if self.__verbose__: print('Done')
def __init__(self,pins,function,risefall='RISING',pud='OFF',bouncetime=250,name='',verbose=False): self.__name__ = name self.__verbose__ = verbose if self.__verbose__: print('Initializing EventPin',self.__name__,'...',end=' ') self.__function__ = function self.__pins__ = General.LoadPins(['in'],pins) self.__eventpinsetup__(pud,risefall,bouncetime,function) if self.__verbose__: print('Done')
def __init__(self, pins, name='', verbose=False): self.__name__ = name # name to refer to self.__verbose__ = verbose # print each action if self.__verbose__: print('Initializing Multi-segment Display', self.__name__, '...', end=' ') self.__pins__ = General.LoadPins( ['h', 'g', 'f', 'e', 'd', 'c', 'b', 'a', '4', '3', '2', '1'], pins) self.__multisegmentdisplaysetup__() if self.__verbose__: print('Done')
def __init__(self, pins, direction=1, speed=50, on=True, name='', verbose=False) -> None: self.__name__ = name self.__verbose__ = verbose if self.__verbose__: print('Initializing DCMotor', self.__name__, '...', end=' ') self.__pins__ = General.LoadPins(['IA', 'IB'], pins) self.__dcmotorsetup__(direction, speed, on) if self.__verbose__: print('Done')