ArduCAM / Arduino

This is ArduCAM library for Arduino boards
MIT License
476 stars 350 forks source link

Serial.print only works with the 240p resolution. Above keeps looping wrong jpeg values #531

Open RikWolk opened 3 years ago

RikWolk commented 3 years ago

`while ( (temp != 0xD9) | (temp_last != 0xFF) ) { temp_last = temp; temp = myCAM.read_fifo(); temp2 = temp; temp2 = temp2, HEX; int tempInt = int(temp2); if(tempInt < 16){ Serial.print("0"); } Serial.print(temp2, HEX); delayMicroseconds(15); //default = 15 getal = getal + 1; if(getal == 2000){ Serial.println(); getal = 0; }

}`

I want to print out the Hex values of the Jpeg image. I can do this with the above code, but it only works with the 240p resolution where I will see the start (FFD8) and the end (FFD9) flags. When trying to print out a higher resolution the start and end flags will never be printed. Instead it does print out hex values but it keeps printing infinitely and after some point the values keep being the same (usually AABBAABBAAABBBABAB something like that). When I use Serial.write however the printing does end and it seems like it's working properly. Why is Serial.print only working with the 240p resolution?

RikWolk commented 3 years ago

I found the problem. The ov5642_reg.h file was broken and only the 240p resolution was correct. I now use the June 2020 version and everything works now.