本文整理汇总了Python中board.MISO属性的典型用法代码示例。如果您正苦于以下问题:Python board.MISO属性的具体用法?Python board.MISO怎么用?Python board.MISO使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类board
的用法示例。
在下文中一共展示了board.MISO属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import board [as 别名]
# 或者: from board import MISO [as 别名]
def __init__(self):
Sensor.__init__(self)
self.moisture_min = float(self.config["soil"]["min"])
self.moisture_max = float(self.config["soil"]["max"])
# create SPI bus
spi = busio.SPI(clock=board.SCK, MISO=board.MISO, MOSI=board.MOSI)
# create the cs (chip select)
cs = digitalio.DigitalInOut(board.D8)
# create the mcp object
mcp = MCP.MCP3008(spi, cs)
# create an analog input channel
self.pin = []
self.pin.append(AnalogIn(mcp, MCP.P0))
self.pin.append(AnalogIn(mcp, MCP.P1))
self.pin.append(AnalogIn(mcp, MCP.P2))
self.pin.append(AnalogIn(mcp, MCP.P3))
self.pin.append(AnalogIn(mcp, MCP.P4))
self.pin.append(AnalogIn(mcp, MCP.P5))
self.pin.append(AnalogIn(mcp, MCP.P6))
self.pin.append(AnalogIn(mcp, MCP.P7))
示例2: __init__
# 需要导入模块: import board [as 别名]
# 或者: from board import MISO [as 别名]
def __init__(self, config: dict, main_thread_running, system_ready):
self.config = config
self.main_thread_running = main_thread_running
self.system_ready = system_ready
self.node_ready = False
spi = busio.SPI(clock=board.SCK, MISO=board.MISO, MOSI=board.MOSI)
cs = digitalio.DigitalInOut(ADCMCP3008Worker.PINS[config['pin']])
self.mcp = MCP.MCP3008(spi, cs)
self.sensors = []
self.init_sensors()
self.node_ready = True