Esempio n. 1
0
 def write_regs(cls, cam, reg_name):
     for r in cls.get_register_value(cam, reg_name):
         if r[0] == "DELAY":
             time.sleep(float(r[1]) / 1000)
             continue
         cls.logger.debug("Writing register to cam {0}: {1}".format(cam.dev_id, r))
         ArducamSDK.Py_ArduCam_writeSensorReg(cam.handle, int(r[0], 16), int(r[1], 16))
Esempio n. 2
0
def writeSensorRegs(fileNodes):
    global handle
    for i in range(0, len(fileNodes)):
        fileNode = fileNodes[i]
        if fileNode[0] == "DELAY":
            time.sleep(float(fileNode[1]) / 1000)
            continue
        regAddr = int(fileNode[0], 16)
        val = int(fileNode[1], 16)
        print(str(regAddr) + "\t" + str(val))
        # ["0x3012","0x0032"] = 12306	50
        # 3012 (hex) = 12306 (dec)
        # 0032 (hex) = 50 (dec)

        ArducamSDK.Py_ArduCam_writeSensorReg(handle, regAddr, val)