Converting a byte array to an image file
问题 I have an Arducam hooked up to an Arduino UNO over SPI. I am having the camera take a photo and send the data back over SPI to my Arduino. I have a python script that is capturing the serial output from the camera (which should be the image data) and saving it to a text file. My python code for saving the data to a text file looks something like this: import serial import time ser = serial.Serial('/dev/cu.usbmodem621', 115200) f = open('data.txt','a') #pause to let everything get warmed up