def capture_thread(self): rtn_val = ArducamSDK.Py_ArduCam_beginCaptureImage(self.handle) self.running = rtn_val == 0 print(f"Capture began {'error' if self.running else ''}, rtn_val = {rtn_val}") while self.running: rtn_val = ArducamSDK.Py_ArduCam_captureImage(self.handle) if rtn_val > 255: print("Error capture image, rtn_val = ", rtn_val) # time.sleep(0.005) ArducamSDK.Py_ArduCam_endCaptureImage(self.handle)
def captureImage_thread(): global handle, running rtn_val = ArducamSDK.Py_ArduCam_beginCaptureImage(handle) if rtn_val != 0: print("Error beginning capture, rtn_val = ", rtn_val) running = False return else: print("Capture began, rtn_val = ", rtn_val) while running: #print "capture" rtn_val = ArducamSDK.Py_ArduCam_captureImage(handle) if rtn_val > 255: print("Error capture image, rtn_val = ", rtn_val) if rtn_val == ArducamSDK.USB_CAMERA_USB_TASK_ERROR: break time.sleep(0.005) running = False ArducamSDK.Py_ArduCam_endCaptureImage(handle)