#_*_ coding:utf-8
importserialimporttimeimporttracebackimportpycurlimportrequestsimportioimportjsonimportbase64
ser= serial.Serial("/dev/ttyAMA0",115200)print(ser.name)print(ser.port)
f=Nonedefmain():print("main:")
res0=setResolution()
res0=reset()print(res0)whileTrue:try:
res1=stopCurrent()print(res1)
res2=getCurrentLength()print(res2)
hBit= res2[7]<<8lBit= res2[8]
imageSize= hBit+lBit;
dataSize= imageSize+10
print(imageSize)
res3=getCurrentImage(res2[7],res2[8],dataSize)
imageData= res3[5:(dataSize-5)]
f= open('/home/pi/Camera/image.jpg','wb')for i inrange(len(imageData)):
f.write(chr(imageData[i]))
f.close
resumCurrent()
upload()exceptException:print(traceback.print_exc())defsetResolution():</