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


Python Board.call_pca方法代码示例

本文整理汇总了Python中Board.call_pca方法的典型用法代码示例。如果您正苦于以下问题:Python Board.call_pca方法的具体用法?Python Board.call_pca怎么用?Python Board.call_pca使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Board的用法示例。


在下文中一共展示了Board.call_pca方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: readSensors

# 需要导入模块: import Board [as 别名]
# 或者: from Board import call_pca [as 别名]
def readSensors(boardAdr, s1, s2, cvals):
               
       # parameters = {}           
       # parameters[boardAdr] = {"spec1": eeprom.realSensorData(boardAdr,1), "spec2": eeprom.realSensorData(boardAdr,2)}
       # print parameters        
       # cvals = parameters#calibrate(boardAdr)        
        #print boardAdr, s1, s2, cvals
        temperature, humidity, pressure = other_sensor()
        board.call_pca(boardAdr)
        time.sleep(0.4)

        time.sleep(0.4)

        time.sleep(0.4)
        ads.get_ads_config0(0x70)
        time.sleep(0.4)
        #print "sensor 1"
        val2 = float(conf_sensor1())
        time.sleep(0.4)
        ads.get_ads_config0(0x60)
        time.sleep(0.4)
        #print "sensor2"
        val1 = float(conf_sensor2())
        
        time.sleep(0.4)
        time.sleep(0.39)   
        #print cvals
        type1 = str(cvals[boardAdr]['spec1'][0])
        type2 = str(cvals[boardAdr]['spec2'][0])
        sensitivity1 = float(cvals[boardAdr]['spec1'][1])
        sensitivity2 = float(cvals[boardAdr]['spec2'][1])
        baseline1 = float(cvals[boardAdr]['spec1'][2])
        baseline2 = float(cvals[boardAdr]['spec2'][2])
        zero1 = float(cvals[boardAdr]['spec1'][3])
        zero2 = float(cvals[boardAdr]['spec2'][3])
        span1 = float(cvals[boardAdr]['spec1'][4])
        span2 = float(cvals[boardAdr]['spec2'][4])
        unit1 = cvals[boardAdr]['spec1'][5]
        unit2 = cvals[boardAdr]['spec2'][5]
        #print val1, val2        
        #con1 = transform(temperature, val1, sensitivity1, baseline1, zero1, span1, type1)
        #con2 = transform(temperature, val2, sensitivity2, baseline2, zero2, span2, type2)
        con1 = val1
        con2 = val2
        print str("Concentration " + str(type1)+ ":" + str(con1)+", " + "Concentration " + str(type2)+ ":" + str(con2))
        #if boardAdr=='87':
        dataline = {"temperature": temperature, "humidity": humidity, "pressure": pressure, "address": boardAdr, "typeSensor1": str(str(type1)+"("+str(boardAdr)+")"), "valueSensor1": val1, "concentrationSensor1": str(con1),  "unit1": str(unit1), "typeSensor2":str(str(type2)+"("+str(boardAdr)+")"), "valueSensor2": val2, "unit2": str(unit2), "concentrationSensor2": str(con2)}
        
        print dataline
        return dataline
开发者ID:parrajeremy,项目名称:Ridley,代码行数:52,代码来源:briza_v3.py

示例2: load_board

# 需要导入模块: import Board [as 别名]
# 或者: from Board import call_pca [as 别名]
def load_board(boardAdr):
	board.call_pca(boardAdr)
        t.sleep(0.4)
        ts = t.time()
        t.sleep(0.4)
        print ts,
        t.sleep(0.4)
        ads.get_ads_config0(0x70)
        t.sleep(0.4)
        #print "sensor 1"
        conf_sensor1()
        t.sleep(0.4)
        ads.get_ads_config0(0x60)
        t.sleep(0.4)
        #print "sensor2"
        conf_sensor2()
        t.sleep(0.4)
        t.sleep(0.39)
开发者ID:jdipika87,项目名称:Project-Ridly,代码行数:20,代码来源:briza.py

示例3: load_board

# 需要导入模块: import Board [as 别名]
# 或者: from Board import call_pca [as 别名]
def load_board():
#    for i in range (0,1):
#        addr = board_addr[i]
        board.call_pca(0x57)
        t.sleep(1)
#        print "\n Board %ld  %ld" %(i, board_addr[i])
        logfile.write("\n Board  ")
#        logfile.write(str(board_addr[i]))
        ts = t.time()
        print "\n time %ld" %ts
        logfile.write("\nTimestamp  = ")
        logfile.write(str(ts))

        print("\n SENSOR 1 ")
        ads.get_ads_config0(0x7C)
        sensor1_conf()
        t.sleep(0.1)
        print("\n SENSOR 2 ")
        ads.get_ads_config0(0x64)
        sensor2_conf()
开发者ID:jdipika87,项目名称:Project-Ridly,代码行数:22,代码来源:briza_o.py


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