本文整理汇总了Python中Board.board_init方法的典型用法代码示例。如果您正苦于以下问题:Python Board.board_init方法的具体用法?Python Board.board_init怎么用?Python Board.board_init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Board
的用法示例。
在下文中一共展示了Board.board_init方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import Board [as 别名]
# 或者: from Board import board_init [as 别名]
def main(boards):
types = {}
cvals = calibrate(boards)
for i in range(len(boards)):
# s1, s2 =
board.board_init(boards[i])
addr = boards[i]
#print s1, s2
types[addr] = str(s1), str(s2)
print types[addr]
#be.com
iteration = 0
while True:
#if iteration < 5:
#cvals = dbcalibrate(boards)
#subprocess
iteration = iteration + 1
#print iteration
try:
#cvals = calibrate(boards)
dataline = []
#print boards
for i in range(len(boards)):
#print types[boards[i]][0], types[boards[i]][1]
data = readSensors(boards[i], types[boards[i]][0], types[boards[i]][1], cvals)
dataline.append(data)
writeSocket(dataline)
except Exception as ex:
print ex
raise
示例2: open
# 需要导入模块: import Board [as 别名]
# 或者: from Board import board_init [as 别名]
import hdc1000 as hdc
import pca9557 as pca
import data_calc as dc
import ads1220 as ads
import sensor_init as s
logfile = open('sensor_data.txt','w')
board_addr = [b_eeprom.board1, b_eeprom.board2, b_eeprom.board3, b_eeprom.board4]
#board.board_init(board_addr[0])
#board.board_init(board_addr[1])
#board.board_init(board_addr[2])
board.board_init(board_addr[3])
lph.configure()
def other_sensor():
humidity = hdc.readHDC_humidity()
logfile.write("\nHumidity = ")
logfile.write(str(humidity))
temperature = hdc.readHDC_temp()
logfile.write("\nTemperature = ")
logfile.write(str(temperature))
pressure = lph.getPressure()
示例3: other_sensor
# 需要导入模块: import Board [as 别名]
# 或者: from Board import board_init [as 别名]
import ads1220 as ads
import populate_sensor_data as sd
import EEPROM as eeprom
import sensor_init as s
import time as t
import Board as board
#initilization of the eeprom is done usinf file briza_eerpom.py
board_addr = [b_eeprom.board1,b_eeprom.board2,b_eeprom.board3,b_eeprom.board4]
#print board_addr
#sen1 ='1'
#sen2 ='2'
board.board_init(board_addr[0])
board.board_init(board_addr[1])
board.board_init(board_addr[2])
board.board_init(board_addr[3])
#configuring other sensors on the board like : humidity, tem, pressure
lph.configure()
def other_sensor():
humidity = hdc.readHDC_humidity()
temperature = hdc.readHDC_temp()
pressure = lph.getPressure()
#configuring the on board sensor configuration
def sensor1(s1):
pca.pca_config(1,0,0)
s.init(s1)