python类OutputDevice()的实例源码

motozero.py 文件源码 项目:picraftzero 作者: WayneKeenan 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def __init__(self):

        self.motor1 = Motor(24, 27)
        self.motor1_enable = OutputDevice(5, initial_value=1)

        # motor2 = Motor(6, 22)
        self.motor2 = Motor(22, 6)
        self.motor2_enable = OutputDevice(17, initial_value=1)

        self.motor3 = Motor(23, 16)
        self.motor3_enable = OutputDevice(12, initial_value=1)

        self.motor4 = Motor(13, 18)
        self.motor4_enable = OutputDevice(25, initial_value=1)

        self.motors = (self.motor1,
                       self.motor2,
                       self.motor3,
                       self.motor4)

        self.motors_enable = (self.motor1_enable,
                              self.motor2_enable,
                              self.motor3_enable,
                              self.motor4_enable)
voice_assistant_initial.py 文件源码 项目:Python-Programming-with-Raspberry-Pi 作者: PacktPublishing 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def __init__(self):
    self.light = OutputDevice(3)
light_scheduler.py 文件源码 项目:Python-Programming-with-Raspberry-Pi 作者: PacktPublishing 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def __init__(self, start_time, stop_time):
        self.start_time = start_time
        self.stop_time = stop_time
        # lamp is connected to GPIO pin2. 
        self.lights = OutputDevice(2)
signal.py 文件源码 项目:IoT-Client 作者: suquark 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def squ_wave(outputdev, freq, sec):
    assert isinstance(outputdev, OutputDevice)
    switch_freq = tick_half(freq)
    tm = timer(sec)
    tm.start()
    while not tm.arrival():
        sleep(switch_freq)
        outputdev.toggle()
    outputdev.value = False
pi.py 文件源码 项目:garage-door 作者: denniskline 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def __init__(self):
        self._garageOpener = OutputDevice(18, active_high=False, initial_value=False)
        pass
light_scheduler.py 文件源码 项目:pywpi 作者: sai-y 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def __init__(self, start_time, stop_time):
        self.start_time = start_time
        self.stop_time = stop_time
        # lamp is connected to GPIO pin2. 
        self.lights = OutputDevice(2)
voice_assistant_initial.py 文件源码 项目:pywpi 作者: sai-y 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def __init__(self):
        self.light = OutputDevice(3)


问题


面经


文章

微信
公众号

扫码关注公众号