What I'm trying to do is use the TTL serial camera I picked up from adafruit to take a picture and output the raw bytes that represent the picture. I'm hoping these bytes correspond to the pixel colors so that I can interpret them and form the jpg on my computer.
The example sketch tutorial from adafruit works fine so I know the camera is working well. Using my own sketch, I am having trouble understanding the serial output I am getting. It just looks like gibberish to me.
Here is a snippet of what the output looks like:
}!1AQaa"q2?¡#B±ÁRÑð$3br?
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz?????????????????¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖ×ØÙÚáâãäåæçèéêñòóôõö÷øùúaw!1AQaaq"2B?¡±Á #3RðbrÑ
Is there anyway to turn this into something more readable so I could potentially turn it into a jpeg later on on my computer?
Here is my code generating the above output:
#include <Adafruit_VC0706.h>
#include <SoftwareSerial.h>
SoftwareSerial cameraconnection = SoftwareSerial(2, 3);
Adafruit_VC0706 cam = Adafruit_VC0706(&cameraconnection);
void setup() {
Serial.begin(9600);
cam.begin();
cam.setImageSize(VC0706_640x480);
delay(1000);
cam.takePicture();
uint16_t jpglen = cam.frameLength();
while (jpglen > 0) {
uint8_t *buffer;
uint8_t bytesToRead = min(32, jpglen);
buffer = cam.readPicture(bytesToRead);
Serial.write(buffer,bytesToRead);
jpglen -= bytesToRead;
}
}
void loop() {
}