but gives me an error when I change frame_size argument to sensor.set_framesize(sensor.B320X320) to the code. I’ve used this before without issue but this has started happening suddenly. Can somebody please advise on how to fix the issue and why it could be happening in the first place?
Which one? The IDE should tell you which one when it connects.
I remember this issue, it was caused by the camera shield missing a reset line, so the sensor some times got stuck on reset. This should have been fixed though.