I am using Arduino Nicla Vision.
I am trying to use the usb_vcp
module. Many of the examples of code that I found on this forum contained the following lines of code to read the compressed image sent by Board
size = struct.unpack('<L', self.port.read(4))[0]
print("size of the image:", size)
image_data = self.port.read(size)
Is there a specific reason we only read 4 bytes to know the size of the data we are sending?
Also, why do we try to access just the first element of the same (aka just accessing the 0th index)?