looking for some code which sende pictures and video over arduino or xbee

hi,

I'm trying to make a drone which transmit picures it photos to the ground. I am new in this. I take the pictures usong arducam. how can I transmit the pictures to the ground? should I convert it to hex first and then transmit it like a string?

Do you have some code which do these actions?

thank you

how can I transmit the pictures to the ground?

Two servos waving semaphore flags.

should I convert it to hex first and then transmit it like a string?

Convert to hex from what?

Do you have some code which do these actions?

What actions?

Post the code that you have that takes the pictures, at least.

PaulS:
Two servos waving semaphore flags.
Convert to hex from what?

I meant- should I convert it to hex first and then I will be able to transmit it to the ground (as a string)?

What actions?

transmit the pictures to the ground

Post the code that you have that takes the pictures, at least.

I answered in the quote

this code should photo the pictures:

//#include <UTFT.h>
#include <SD.h>
#include <Wire.h>
#include <ArduCAM.h>
#include <avr/pgmspace.h>

#define SD_CS 9

//UTFT(byte model, int RS, int WR, int RD, int CS)
//UTFT myGLCD(ITDB32S,A2,A1,A0,10); // Remember to change the model parameter to suit your display module!
//ArduCAM(byte model,int RS, int WR, int RD, int REG_CS, int FIFO_CS)
ArduCAM myCAM(OV2640,A2,A1,A0,A3,10); // Remember to change the model parameter to suit your canera module!

void setup()
{
//Initialize I2C Bus
Wire.begin();
//Switch to FIFO Mode
myCAM.write_reg(ARDUCHIP_TIM, MODE_MASK);
//Set sensor to JPEG mode. Note don’t all the camera modules support JPEG mode
myCAM.OV2640_set_format(JPEG);
//Initialize Camera Module
myCAM.InitCAM();
myCAM.OV2640_set_JPEG_size(OV2640_320x240);

//Initialize SD Card
if (!SD.begin(SD_CS))
{
//while (1); //If failed, stop here
}
}

void loop()
{
char str[8];
File outFile;
static int k = 0;
uint8_t temp,temp_last;
uint8_t start_capture = 0;

//Wait trigger from shutter buttom
if(myCAM.read_reg(ARDUCHIP_TRIG) & SHUTTER_MASK)
{
//Wait until buttom released
while(myCAM.read_reg(ARDUCHIP_TRIG) & SHUTTER_MASK);
start_capture = 1;
}

//Start capture when detect a valid shutter press
if(start_capture)
{
//Flush the FIFO
myCAM.flush_fifo();
//Start capture
myCAM.start_capture();
}

if(myCAM.read_reg(ARDUCHIP_TRIG) & CAP_DONE_MASK)
{
//Construct a file name
k = k + 1;
itoa(k, str, 10);
strcat(str,".jpg");
//Open the new file
outFile = SD.open(str,FILE_WRITE);
if (! outFile)
return;
//Enable FIFO
myCAM.enable_fifo();
//Read the first dummy byte from FIFO
temp = myCAM.read_fifo();
//Read JPEG data from FIFO
while( (temp != 0xD9) | (temp_last != 0xFF) )
{
temp_last = temp;
temp = myCAM.read_fifo();
//Write image data to file
outFile.write(temp);
}
//Disable FIFO when all the image data is saved to the file
myCAM.disable_fifo();
//Close the file
outFile.close();

//Clear the capture done flag
myCAM.clear_fifo_flag();
//Clear the start capture flag
start_capture = 0;
}
}

So, that code takes a picture, and then reads the picture data from the camera and writes it to an SD card.

That EXACT same process would be used, but instead of writing the data to a file, write the data to the SoftwareSerial instance the XBee is connected to.

Have you timed how long it takes to save the picture? That will define your frame rate for sending video.

PaulS: instead of writing the data to a file, write the data to the SoftwareSerial instance the XBee is connected to.

Have you timed how long it takes to save the picture? That will define your frame rate for sending video.

how can I do this? what is the command for doing this?

How is the XBee connected to the Arduino? How is the XBee configured? What part of the project are YOU doing?

PaulS:
How is the XBee connected to the Arduino? How is the XBee configured? What part of the project are YOU doing?

I really don’t know, I just look for a code which send the photo through the xbee. as I said, i’m new is this

I really don't know

If you don't know how the XBee is connected to the Arduino, you can not use it to send data. Come on back when you have figured that out.