當前位置: 首頁>>代碼示例>>Python>>正文


Python GPIO.HIGH屬性代碼示例

本文整理匯總了Python中Adafruit_BBIO.GPIO.HIGH屬性的典型用法代碼示例。如果您正苦於以下問題:Python GPIO.HIGH屬性的具體用法?Python GPIO.HIGH怎麽用?Python GPIO.HIGH使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在Adafruit_BBIO.GPIO的用法示例。


在下文中一共展示了GPIO.HIGH屬性的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: high

# 需要導入模塊: from Adafruit_BBIO import GPIO [as 別名]
# 或者: from Adafruit_BBIO.GPIO import HIGH [as 別名]
def high(self):
        GPIO.output(self.port, GPIO.HIGH) 
開發者ID:daq-tools,項目名稱:kotori,代碼行數:4,代碼來源:gpio.py

示例2: output

# 需要導入模塊: from Adafruit_BBIO import GPIO [as 別名]
# 或者: from Adafruit_BBIO.GPIO import HIGH [as 別名]
def output(self, pin, value):
        """Set the specified pin the provided high/low value.  Value should be
        either HIGH/LOW or a boolean (true = high)."""
        raise NotImplementedError 
開發者ID:adafruit,項目名稱:Adafruit_Python_GPIO,代碼行數:6,代碼來源:GPIO.py

示例3: input

# 需要導入模塊: from Adafruit_BBIO import GPIO [as 別名]
# 或者: from Adafruit_BBIO.GPIO import HIGH [as 別名]
def input(self, pin):
        """Read the specified pin and return HIGH/true if the pin is pulled high,
        or LOW/false if pulled low."""
        raise NotImplementedError 
開發者ID:adafruit,項目名稱:Adafruit_Python_GPIO,代碼行數:6,代碼來源:GPIO.py

示例4: set_high

# 需要導入模塊: from Adafruit_BBIO import GPIO [as 別名]
# 或者: from Adafruit_BBIO.GPIO import HIGH [as 別名]
def set_high(self, pin):
        """Set the specified pin HIGH."""
        self.output(pin, HIGH) 
開發者ID:adafruit,項目名稱:Adafruit_Python_GPIO,代碼行數:5,代碼來源:GPIO.py

示例5: output_pins

# 需要導入模塊: from Adafruit_BBIO import GPIO [as 別名]
# 或者: from Adafruit_BBIO.GPIO import HIGH [as 別名]
def output_pins(self, pins):
        """Set multiple pins high or low at once.  Pins should be a dict of pin
        name to pin value (HIGH/True for 1, LOW/False for 0).  All provided pins
        will be set to the given values.
        """
        # General implementation just loops through pins and writes them out
        # manually.  This is not optimized, but subclasses can choose to implement
        # a more optimal batch output implementation.  See the MCP230xx class for
        # example of optimized implementation.
        for pin, value in iter(pins.items()):
            self.output(pin, value) 
開發者ID:adafruit,項目名稱:Adafruit_Python_GPIO,代碼行數:13,代碼來源:GPIO.py

示例6: input_pins

# 需要導入模塊: from Adafruit_BBIO import GPIO [as 別名]
# 或者: from Adafruit_BBIO.GPIO import HIGH [as 別名]
def input_pins(self, pins):
        """Read multiple pins specified in the given list and return list of pin values
        GPIO.HIGH/True if the pin is pulled high, or GPIO.LOW/False if pulled low.
        """
        # General implementation that can be optimized by derived classes.
        return [self.input(pin) for pin in pins] 
開發者ID:adafruit,項目名稱:Adafruit_Python_GPIO,代碼行數:8,代碼來源:GPIO.py

示例7: set_disabled

# 需要導入模塊: from Adafruit_BBIO import GPIO [as 別名]
# 或者: from Adafruit_BBIO.GPIO import HIGH [as 別名]
def set_disabled(self):
    GPIO.output(self.pin, GPIO.HIGH) 
開發者ID:intelligent-agent,項目名稱:redeem,代碼行數:4,代碼來源:Enable.py

示例8: forward

# 需要導入模塊: from Adafruit_BBIO import GPIO [as 別名]
# 或者: from Adafruit_BBIO.GPIO import HIGH [as 別名]
def forward(self, rpm):
        GPIO.output(self.directionPin, GPIO.HIGH)
        self.setSpeed(rpm) 
開發者ID:ericboehlke,項目名稱:BB-8,代碼行數:5,代碼來源:StepperMotor.py

示例9: ledBlink

# 需要導入模塊: from Adafruit_BBIO import GPIO [as 別名]
# 或者: from Adafruit_BBIO.GPIO import HIGH [as 別名]
def ledBlink(data):
  if data.data = true:
     GPIO.output(LED, GPIO.HIGH)
     time.sleep(0.5)
     GPIO.output(LED, GPIO.LOW)
     time.sleep(0.5) 
開發者ID:PacktPublishing,項目名稱:ROS-Robotics-Projects-SecondEdition,代碼行數:8,代碼來源:beagleboneblack_gpio.py

示例10: __init__

# 需要導入模塊: from Adafruit_BBIO import GPIO [as 別名]
# 或者: from Adafruit_BBIO.GPIO import HIGH [as 別名]
def __init__(self):
        global GPIO
        try:
            import Adafruit_BBIO.GPIO as GPIO
        except ImportError:
            raise ImportError(self._import_error_msg)

        super(BeagleBoneBlack, self).__init__()

        self.PIN_MODES = {
            pingo.IN: GPIO.IN,
            pingo.OUT: GPIO.OUT,
        }

        self.PIN_STATES = {
            pingo.HIGH: GPIO.HIGH,
            pingo.LOW: GPIO.LOW,
        }

        gpio_pins = [pingo.DigitalPin(self, location, gpio_id)
                     for location, gpio_id in self.PINS.items()]
        ground_pins = [pingo.GroundPin(self, location)
                       for location in self.GND_PINS]
        vcc_pins = [pingo.VccPin(self, location, voltage)
                    for location, voltage in self.VCC_PINS.items()]

        self._add_pins(gpio_pins + ground_pins + vcc_pins) 
開發者ID:pingo-io,項目名稱:pingo-py,代碼行數:29,代碼來源:bbb.py

示例11: _get_pin_state

# 需要導入模塊: from Adafruit_BBIO import GPIO [as 別名]
# 或者: from Adafruit_BBIO.GPIO import HIGH [as 別名]
def _get_pin_state(self, pin):
        return pingo.HIGH if GPIO.input(pin.location) else pingo.LOW 
開發者ID:pingo-io,項目名稱:pingo-py,代碼行數:4,代碼來源:bbb.py


注:本文中的Adafruit_BBIO.GPIO.HIGH屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。