本文整理汇总了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)
示例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
示例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
示例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)
示例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)
示例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]
示例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)
示例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)
示例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)
示例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)
示例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