本文整理汇总了Python中Adafruit_BBIO.GPIO.LOW属性的典型用法代码示例。如果您正苦于以下问题:Python GPIO.LOW属性的具体用法?Python GPIO.LOW怎么用?Python GPIO.LOW使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类Adafruit_BBIO.GPIO
的用法示例。
在下文中一共展示了GPIO.LOW属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: input
# 需要导入模块: from Adafruit_BBIO import GPIO [as 别名]
# 或者: from Adafruit_BBIO.GPIO import LOW [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
示例2: low
# 需要导入模块: from Adafruit_BBIO import GPIO [as 别名]
# 或者: from Adafruit_BBIO.GPIO import LOW [as 别名]
def low(self):
GPIO.output(self.port, GPIO.LOW)
示例3: output
# 需要导入模块: from Adafruit_BBIO import GPIO [as 别名]
# 或者: from Adafruit_BBIO.GPIO import LOW [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
示例4: set_low
# 需要导入模块: from Adafruit_BBIO import GPIO [as 别名]
# 或者: from Adafruit_BBIO.GPIO import LOW [as 别名]
def set_low(self, pin):
"""Set the specified pin LOW."""
self.output(pin, LOW)
示例5: is_low
# 需要导入模块: from Adafruit_BBIO import GPIO [as 别名]
# 或者: from Adafruit_BBIO.GPIO import LOW [as 别名]
def is_low(self, pin):
"""Return true if the specified pin is pulled low."""
return self.input(pin) == LOW
# Basic implementation of multiple pin methods just loops through pins and
# processes each one individually. This is not optimal, but derived classes can
# provide a more optimal implementation that deals with groups of pins
# simultaneously.
# See MCP230xx or PCF8574 classes for examples of optimized implementations.
示例6: output_pins
# 需要导入模块: from Adafruit_BBIO import GPIO [as 别名]
# 或者: from Adafruit_BBIO.GPIO import LOW [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)
示例7: input_pins
# 需要导入模块: from Adafruit_BBIO import GPIO [as 别名]
# 或者: from Adafruit_BBIO.GPIO import LOW [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.
"""
# maybe rpi has a mass read... it would be more efficient to use it if it exists
return [self.rpi_gpio.input(pin) for pin in pins]
示例8: set_enabled
# 需要导入模块: from Adafruit_BBIO import GPIO [as 别名]
# 或者: from Adafruit_BBIO.GPIO import LOW [as 别名]
def set_enabled(self):
GPIO.output(self.pin, GPIO.LOW)
示例9: reverse
# 需要导入模块: from Adafruit_BBIO import GPIO [as 别名]
# 或者: from Adafruit_BBIO.GPIO import LOW [as 别名]
def reverse(self, rpm):
GPIO.output(self.directionPin, GPIO.LOW)
self.setSpeed(rpm)
示例10: ledBlink
# 需要导入模块: from Adafruit_BBIO import GPIO [as 别名]
# 或者: from Adafruit_BBIO.GPIO import LOW [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)
示例11: __init__
# 需要导入模块: from Adafruit_BBIO import GPIO [as 别名]
# 或者: from Adafruit_BBIO.GPIO import LOW [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)