Capturing TTL camera image over Bluetooth

I am using Adafruit Miniture TTL Camera, LE Bluetooth, and MircoSD.
I am wondering if there is an Arduino sketch where I can transfer the image taken via the Bluetooth or how can I being about doing this?

I have attached an image of my circuit.

Would this code work?

#include <Adafruit_VC0706.h>
#include <SPI.h>
#include <SD.h>
#include <SoftwareSerial.h>
#include “Adafruit_BLE_UART.h”

#define chipSelect 10
#define ADAFRUITBLE_REQ 8
#define ADAFRUITBLE_RDY 2 // This should be an interrupt pin, on Uno thats #2 or #3
#define ADAFRUITBLE_RST 9

//Connection of Bluetooth
Adafruit_BLE_UART BTLEserial = Adafruit_BLE_UART(ADAFRUITBLE_REQ, ADAFRUITBLE_RDY, ADAFRUITBLE_RST);

//Connection of Camera
SoftwareSerial cameraconnection = SoftwareSerial(5, 3);
Adafruit_VC0706 cam = Adafruit_VC0706(&cameraconnection);
char data = ‘9’;

void setup() {

// When using hardware SPI, the SS pin MUST be set to an
// output (even if not connected or used). If left as a
// floating input w/SPI on, this can cause lockuppage.
#if !defined(SOFTWARE_SPI)
#if defined(AVR_ATmega1280) || defined(AVR_ATmega2560)
if(chipSelect != 53) pinMode(53, OUTPUT); // SS on Mega
#else
if(chipSelect != 10) pinMode(10, OUTPUT); // SS on Uno, etc.
#endif
#endif

Serial.begin(9600);
Serial.println(“VC0706 Camera snapshot test”);
Serial.println(F(“Adafruit Bluefruit Low Energy nRF8001 Print echo demo”));

// see if the card is present and can be initialized:
if (!SD.begin(chipSelect)) {
Serial.println(“Card failed, or not present”);
// don’t do anything more:
return;
}

// Try to locate the camera
if (cam.begin()) {
Serial.println(“Camera Found:”);
} else {
Serial.println(“No camera found?”);
return;
}

BTLEserial.begin();
}

//
/*!
Constantly checks for new events on the nRF8001
*/
/
/
aci_evt_opcode_t laststatus = ACI_EVT_DISCONNECTED;

void loop()
{
// Tell the nRF8001 to do whatever it should be working on.
BTLEserial.pollACI();

if (BTLEserial.available()) {
Serial.println(“Started”);
data = BTLEserial.read();
BTLEserial.flush();
}

switch(data)
{
case ‘1’: takePhoto();
Serial.println(“Taking picture”);
data = ‘9’;
break;
}
}
void takePhoto()
{
if (cam.begin()) {
Serial.println(“Camera Found:”);
} else {
Serial.println(“No camera found?”);
return;
}
cam.setImageSize(VC0706_640x480); // biggest
Serial.println(“Snap in 3 secs…”);
delay(3000);
if (! cam.takePicture())
Serial.println(“Failed to snap!”);
else
Serial.println(“Picture taken!”);

// Create an image with the name IMAGExx.JPG
char filename[13];
strcpy(filename, “IMAGE00.JPG”);
for (int i = 0; i < 100; i++) {
filename[5] = ‘0’ + i/10;
filename[6] = ‘0’ + i%10;
// create if does not exist, do not open existing, write, sync after write
if (! SD.exists(filename)) {
break;
}
}
// Open the file for writing
File imgFile = SD.open(filename, FILE_WRITE);

// Get the size of the image (frame) taken
uint16_t jpglen = cam.frameLength();
Serial.print(“Storing “);
Serial.print(jpglen, DEC);
Serial.print(” byte image.”);

int32_t time = millis();
pinMode(8, OUTPUT);
// Read all the data up to # bytes!
byte wCount = 0; // For counting # of writes
while (jpglen > 0) {
// read 32 bytes at a time;
uint8_t *buffer;
uint8_t bytesToRead = min(32, jpglen); // change 32 to 64 for a speedup but may not work with all setups!
buffer = cam.readPicture(bytesToRead);
imgFile.write(buffer, bytesToRead);
if(++wCount >= 64) { // Every 2K, give a little feedback so it doesn’t appear locked up
Serial.print(’.’);
wCount = 0;
}
//Serial.print(“Read “); Serial.print(bytesToRead, DEC); Serial.println(” bytes”);
jpglen -= bytesToRead;
}
imgFile.close();
}

(deleted)

Please edit your post to add code tags ("</>") button. See “How to use this forum”.