So I have this camera http://www.cutedigi.com/blog/?p=41 and I've been trying to figure out how to use it. I contacted the manufacturer, Linksprite, who directed me to that page. I'm trying to follow that tutorial with the coding so I can learn more about how to use it so I can use it in other things, but I have a hard time getting the code to work in general. I tried contacting SparkFun, but they just told me to use the older version of Arduino, which doesn't work with some of the other shields I am using.

Has anyone successfully taken a picture with the camera and saved it to an SD card?

It means it is looking for a file called WProgram.h and can't find it because it is not used any more.You need to edit the library file called JPEGCamera.h and where it says WProgram.h replace it with Arduino.h

I would, but I'm trying to make a cell phone sort of thing with a camera, and the GSM shield I'm using has the library in Arduino IDE 1.0.4 or above, and I have to modify one of them some way or the other.

So I edited the JPEGCamera library, and it stopped giving me error messages (which I hope is a good thing). I changed things like Serial.print(XXX, BYTE) to Serial.write(XXX) and changed all of the WProgram.h's to Arduino.h.

Where that last one is the thing I added. However, when I try to use the function (i.e. camera.isAvailable()), it keeps returning false. Is there something wrong with the wiring of my camera, or is there something inherently wrong with what I am trying?

// This is a motion-detect camera sketch using the Adafruit VC0706 library.// On start, the Arduino will find the camera and SD card and turn// on motion detection. If motion is detected, the camera will// snap a photo, saving it to the SD card.// Public domain.

// If using an Arduino Mega (1280, 2560 or ADK) in conjunction// with an SD card shield designed for conventional Arduinos// (Uno, etc.), it's necessary to edit the library file:// libraries/SD/utility/Sd2Card.h// Look for this line:// #define MEGA_SOFT_SPI 0// change to:// #define MEGA_SOFT_SPI 1// This is NOT required if using an SD card breakout interfaced// directly to the SPI bus of the Mega (pins 50-53), or if using// a non-Mega, Uno-style board.

#include <Adafruit_VC0706.h>#include <SD.h>#include <GSM.h>

// comment out this line if using Arduino V23 or earlier#include <SoftwareSerial.h>

// uncomment this line if using Arduino V23 or earlier// #include <NewSoftSerial.h>

// Pins for camera connection are configurable.// With the Arduino Uno, etc., most pins can be used, except for// those already in use for the SD card (10 through 13 plus// chipSelect, if other than pin 10).// With the Arduino Mega, the choices are a bit more involved:// 1) You can still use SoftwareSerial and connect the camera to// a variety of pins...BUT the selection is limited. The TX// pin from the camera (RX on the Arduino, and the first// argument to SoftwareSerial()) MUST be one of: 62, 63, 64,// 65, 66, 67, 68, or 69. If MEGA_SOFT_SPI is set (and using// a conventional Arduino SD shield), pins 50, 51, 52 and 53// are also available. The RX pin from the camera (TX on// Arduino, second argument to SoftwareSerial()) can be any// pin, again excepting those used by the SD card.// 2) You can use any of the additional three hardware UARTs on// the Mega board (labeled as RX1/TX1, RX2/TX2, RX3,TX3),// but must specifically use the two pins defined by that// UART; they are not configurable. In this case, pass the// desired Serial object (rather than a SoftwareSerial// object) to the Adafruit_VC0706 constructor.

// 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("SMS Trigger");

// 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; }