当前位置: 首页>>代码示例>>Python>>正文


Python Board.board_init方法代码示例

本文整理汇总了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
开发者ID:parrajeremy,项目名称:Ridley,代码行数:34,代码来源:briza_v3.py

示例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()
开发者ID:jdipika87,项目名称:Project-Ridly,代码行数:33,代码来源:briza_o.py

示例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)
开发者ID:jdipika87,项目名称:Project-Ridly,代码行数:33,代码来源:briza.py


注:本文中的Board.board_init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。