Arduino+camera+pc

iam using arduino mega 2560 and linksprite jpeg serial camera. Iam getting continuous pictures in hex form.
I want to save the pictures directly to some folder. i dont want to use SD card. plz guide me.
i shall be very thankfull to u :slight_smile:
here is the code.

byte incomingbyte; 

int a=0x0000,  //Read Starting address     
    j=0,
    k=0,
    count=0;
uint8_t MH,ML;
boolean EndFlag=0;


void setup() { 
  Serial.begin(19200);
  Serial1.begin(38400);
  
  SendResetCmd();
  delay(3000);
}

void loop() {
  SendTakePhotoCmd();
  
  Serial.println("Start pic"); 
  delay(100);

  while(Serial1.available()>0) {
    incomingbyte=Serial1.read();
  }
  byte b[32];
      
  while(!EndFlag) {  
    j=0;
    k=0;
    count=0;
    SendReadDataCmd();
           
    delay(75); //try going up
    while(Serial1.available()>0) {
      incomingbyte=Serial1.read();
      k++;
      if((k>5)&&(j<32)&&(!EndFlag)) {
        b[j]=incomingbyte;
        if((b[j-1]==0xFF)&&(b[j]==0xD9))
        EndFlag=1;                           
        j++;
        count++;
      }
    }
            
    for(j=0;j<count;j++) {   
      if(b[j]<0x10)
        Serial.print("0");
      Serial.print(b[j], HEX);
    }
    Serial.println();
  }
  
  delay(3000);
  EndFlag = 0; // reset so that another picture can be taken
  Serial.println("End of pic");
  Serial.println(); 
}

//Send Reset command
void SendResetCmd() {
  Serial1.write((byte)0x56);
  Serial1.write((byte)0x00);
  Serial1.write((byte)0x26);
  Serial1.write((byte)0x00);   
}

//Send take picture command
void SendTakePhotoCmd() {
  Serial1.write((byte)0x56);
  Serial1.write((byte)0x00);
  Serial1.write((byte)0x36);
  Serial1.write((byte)0x01);
  Serial1.write((byte)0x00);
    
  a = 0x0000; //reset so that another picture can taken
}

void FrameSize() {
  Serial1.write((byte)0x56);
  Serial1.write((byte)0x00);
  Serial1.write((byte)0x34);
  Serial1.write((byte)0x01);
  Serial1.write((byte)0x00);  
}

//Read data
void SendReadDataCmd() {
  MH=a/0x100;
  ML=a%0x100;
      
  Serial1.write((byte)0x56);
  Serial1.write((byte)0x00);
  Serial1.write((byte)0x32);
  Serial1.write((byte)0x0c);
  Serial1.write((byte)0x00);
  Serial1.write((byte)0x0a);
  Serial1.write((byte)0x00);
  Serial1.write((byte)0x00);
  Serial1.write((byte)MH);
  Serial1.write((byte)ML);
  Serial1.write((byte)0x00);
  Serial1.write((byte)0x00);
  Serial1.write((byte)0x00);
  Serial1.write((byte)0x20);
  Serial1.write((byte)0x00);
  Serial1.write((byte)0x0a);

  a+=0x20; 
}

void StopTakePhotoCmd() {
  Serial1.write((byte)0x56);
  Serial1.write((byte)0x00);
  Serial1.write((byte)0x36);
  Serial1.write((byte)0x01);
  Serial1.write((byte)0x03);        
}

I want to save the pictures directly to some folder.

To some folder where? If you are talking about a folder on the PC, then the application that reads the serial data, on the PC, needs to do that. That is NOT an Arduino issue.

yup on the pc. I found Processing but it seems to be quite complex.
any other easy way?

i have read almost all posts related to this on this forum but no suitable answer. iam trying it by myself just need little guidance :slight_smile:

isshh_sidd:
yup on the pc. I found Processing but it seems to be quite complex.
any other easy way?

In my view Processing is the easiest option.

can you send me the code plz? I've been looking for an hour and I haven't found a way to do it.

isshh_sidd:
can you send me the code plz?

No!!!
This is not a code writing service. This is a help forum.