Camera C329 error "avrdude: stk500_getsync(): not in sync: resp=0x00"

I looked into this forum for similar concepts and I found one where the solution was integrating a voltage divider to ensure the correct voltage is going to and from the arduino UNO and the device. I’m currently using this setup
The problem is every time I try to compile the code I receive this error
“avrdude: stk500_getsync(): not in sync: resp=0x00”
The code that I’m using is just the example and the libraries sent to me by where I purchased the camera GitHub - svoisen/c329: Arduino library for Electronics123 C329 camera.
I’ve double checked the datasheet for the camera and the datasheet for the Uno to ensure my voltage divider puts 3V in the TX line. I’m stumped, I hope I’m posting in the correct section and thank you for any help in advance.
EDIT:
My apologies for convenience this is the code I’m using

#include <SD.h>
#include "CameraC329.h"

#define CAMERA_BAUD 14400

CameraC329 camera;
File photoFile;
uint32_t writtenPictureSize;

void getPicture_callback(uint32_t pictureSize, uint16_t packetSize, uint32_t packetStartPosition, byte* packet)
{
  photoFile.write(packet, packetSize);
  writtenPictureSize += packetSize;
  
  if (writtenPictureSize >= pictureSize)
  {
    photoFile.flush();
    photoFile.close();
    Serial.println("SUCCESS");
  }
}

void setup()
{
  Serial.begin(CAMERA_BAUD);
  
  if (!SD.begin(4))
  {
    Serial.println("SD initialization failed");
    return;
  }
  
  photoFile = SD.open("photo.jpg", FILE_WRITE);
  photoFile.seek(0);
  writtenPictureSize = 0;
  
  delay(2000);

  if (!camera.sync())
  {
    Serial.println("Sync failed");
    return;
  }

  if (!camera.initialize(CameraC329::BAUD14400, CameraC329::CT_JPEG, CameraC329::PR_160x120, CameraC329::JR_320x240))
  {
    Serial.println("Initialize failed");
    return;
  }
  
  if (!camera.setQuality(CameraC329::QL_BEST))
  {
    Serial.println("Set quality failed");
    return;
  }
      
  if (!camera.getPicture(CameraC329::PT_JPEG_PREVIEW, &getPicture_callback))
  {
    Serial.println("Get Picture Failed");
    return;
  }
}

void loop()
{
}

The problem is every time I try to compile the code I receive this error

No, you don't. You get that when you try to upload, because the camera is interfering. Unplug the camera to upload a new sketch.

I'm sorry, that's correct. Whenever the camera is connected this occurs. I tried this and it didn't function properly so I assumed it would only work if it compiled while the camera was connected.

EDIT Also my apologies I also forgot to mention I am using Arduino 1.04 and I have done the proposed changes to this code to function. Like change the headers from WProgram and associated files to Arduino.h in the libraries and the "serial.print"s to "serial.write"

Whenever the camera is connected this occurs.

Then you know what to do.

I tried this and it didn't function properly so I assumed it would only work if it compiled while the camera was connected.

The compiler has no idea that the camera exists, or LEDs or switches or LCDs or microphones or motors or a any of the millions of other things that might get connected the Arduino.

I was also having a problem with the c329 code and was wondering if someone could help me.

The problem is that for the initialize method, I can't change the preview resolution or the jpeg resolution. When I tried changing the jpeg resolution to 640x480, the camera failed to sync. It only seems to recognize 160x120 for the preview and 320x240 for the picture itself (you can tell because the code turns blue for these parameters but goes black for any other one). The strange thing is that there are 10 other resolutions defined in the header file and the test program isn't recognizing any of them. The same is true for the color type. Please let me know if anyone has encountered this problem and any possible solutions.

That avrdude error comes from the uploader. Not the compiler.

When you do a “compile and upload” operation on the Arduino, that is actually two completely separate operations. The IDE runs the compiler and then it runs the uploader. You can do these operations completely separately, if you want to.

So what PaulS said in his first reply to your problem, is completely correct.

You didn't say what model of Arduino you are using.

If you have only one serial port, then the serial port is connected to both the USB connection to your PC, and it is also connected to the RX and TX pins of the arduino, which you have connected to your camera.

Your attempt to ground the TX serial pin from the arduino, is probably going to interfere with the proper operation of the serial port ( through the USB connector ), when the uploader on the PC tries to communicate with the arduino. That is probably your problem, right there.

atess001: I was also having a problem with the c329 code and was wondering if someone could help me.

The problem is that for the initialize method, I can't change the preview resolution or the jpeg resolution. When I tried changing the jpeg resolution to 640x480, the camera failed to sync. It only seems to recognize 160x120 for the preview and 320x240 for the picture itself (you can tell because the code turns blue for these parameters but goes black for any other one). The strange thing is that there are 10 other resolutions defined in the header file and the test program isn't recognizing any of them. The same is true for the color type. Please let me know if anyone has encountered this problem and any possible solutions.

Synch first, then initialize with your new resolution. Not all c329 based cameras are capable of those resolutions, but the header files is intended to cover several different cameras based on the same chip. Read your datasheet to see what your camera can do. The test program you mention, is it a windows program or an arduino program? If it is the windows program I'm thinking of, try loading the arduino with a blank sketch instead of the one you posted. The idea is that the Arduino only serves as a dumb USB-TTL serial adapter. But this is only intended to test that your camera was not DOA.

Synch first, then initialize with your new resolution. Not all c329 based cameras are capable of those resolutions, but the header files is intended to cover several different cameras based on the same chip. Read your datasheet to see what your camera can do. The test program you mention, is it a windows program or an arduino program? If it is the windows program I'm thinking of, try loading the arduino with a blank sketch instead of the one you posted. The idea is that the Arduino only serves as a dumb USB-TTL serial adapter. But this is only intended to test that your camera was not DOA.

The model Arduino I am using is the Arduino UNO. I'm running the code using the arduino 1.0.1 software for windows. I'm using the c329 UART-board color JPEG compression VGA camera module. According to the datasheet, the camera should support 640x480 for the compression resolution. There are even some sample pictures on the electronics123 site. http://www.electronics123.com/s.nl/it.A/id.3010/.f

And the program I'm using is an arduino program, the same code posted at the beginning of this topic. The only thing I change is the "PR" and "JR" values at the initialize method. Although PR_640x480 is defined as an enumeration in the .h file, it doesn't seem to be recognized. When an enumeration is recognized in the code, the text changes color. The enumerations I use are all staying black instead of turning blue. This shouldn't happen since all the resolutions are defined in the same place.

The enumerations I use are all staying black instead of turning blue.

The color is eye-candy, often wrong. If the code compiles, THAT is all that matters.