VDIP1 and Arduino Problems for 1 Pixel Camera!

Please if anyone could help I would be eternally grateful.

I am trying to get an Arduino to record the colour of the light and gps position as I move around - i have got both these things working - the trouble I am having is recording the results on a USB stick.

I am using the VDIP1 from http://www.vinculum.com/prd_vdip1.html.

I have connected the arduino to the VDIPs pins 6 and 8 (tried 4 and 5 too), and to a power supply.

I have tried the code from numerous tutorials and this forum, but nothing I do writes files to the USB stick - although the LEDs flash intermittantly on the VDIP.

Have I wired it up correctly? Can anyone give me a dummys guide to getting it going?

Many thanks.

Latest code follows:

#include "AFSoftSerial.h"

AFSoftSerial mySerial = AFSoftSerial(6, 8);

int fileNumber = 0;

void setup() {
pinMode(13, OUTPUT);
Serial.begin(9600);
// set the data rate for the SoftwareSerial port
Serial.println("initiating the VDIP");
mySerial.begin(9600);
mySerial.print("IPA"); // sets the vdip to use ascii numbers (so I can read them in the code easily!)
mySerial.print(13, BYTE); // return character to tell vdip its end of message
delay(10000); //10 seconds to init the disk before writing (some disks may take longer)
Serial.println("finished initiating the VDIP");

}

void loop() { // run over and over again

Serial.println("start loop");

if(fileNumber < 10){ //(mySerial.available()) {
//Serial.println("serial available");
mySerial.print("OPW LOG"); // open to write creates a file - named
mySerial.print(fileNumber); // LOG%1.TXT first time round - .TXT is for the computer
mySerial.print(".TXT"); // I have used the % sign in the name so I can search the disk for log files that it has created so as not to overwrite any that may be on already
mySerial.print(13, BYTE); // return character

delay(2000);

mySerial.print("WRF "); //write to file (file needs to have been opened to write first)
mySerial.print(6); //needs to then be told how many characters will be written
mySerial.print(13, BYTE); //return to say command is finished
mySerial.print("123456"); //followed by the info to write
mySerial.print(13, BYTE); //write a return to the contents of the file (so each entry appears on a new line)
delay(2000);
mySerial.print("CLF LOG"); // it closes the file
mySerial.print(fileNumber); // LOG%1.TXT
mySerial.print(".TXT");
mySerial.print(13, BYTE); // return character

Serial.println("wrote file "+fileNumber);

fileNumber++; //so we can create other files

delay(2000);
}else{
Serial.println("finished");
//Serial.println("serial unavailable");
//delay(1000);
}
}

mySerial.print("WRF "); //write to file (file needs to have been opened to write first)
mySerial.print(6); //needs to then be told how many characters will be written
mySerial.print(13, BYTE); //return to say command is finished
mySerial.print("123456"); //followed by the info to write
mySerial.print(13, BYTE); //write a return to the contents of the file (so each entry appears on a new line)

You sending 7 characters as you are sending 123456 and the return character before the clf command.

Also you may be getting the same problems everyone is because we are not implementing handshaking for the device

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1208060365/0#8

HTH

HTH

Can I check what pins I should have connected on the VDIP1? Many thanks, Mathew

I dont have the pinouts in front of me, but you need to connect the tx of the vdip to the rx of the arduino, and the rx of the vdip to the tx of the arduino.

Unless you are coding handshaking, connect the cts to the rts pin - this is not to reliable though worked for me for occasional short messages.

HTH

Thanks for your help. Will try again monday and see what happens...

Yes that is what I have been trying.

I connected:
VDIP 1 to 5v
VDIP 6 to Arduino 6
VDIP 7 to Ground
VDIP 8 to Arduino 8

I tried swapping pins 6 and 8 around in case I got it wrong. I leave the Arduino plugged in the computer for power and to debug messages via Serial Monitor.

LED1 on the VDIP is always on. No jumpers are connected on the VDIP - do i need to connect any?

On the Serial Monitor for debuggin I get the following (note the missing letters)... Any ideas for what I could try?

initiating the VDIP

finished initiating the VDIP

start loop

wrote file

start loop

rote file

start loop

ote file

start loop

te file

start loop

e file

start loop

finished

Code here...

#include "AFSoftSerial.h"

AFSoftSerial mySerial = AFSoftSerial(6, 8);

int fileNumber = 0;

void setup() {
pinMode(13, OUTPUT);
Serial.begin(9600);
// set the data rate for the SoftwareSerial port
Serial.println("initiating the VDIP");
mySerial.begin(9600);
mySerial.print("IPA"); // sets the vdip to use ascii numbers (so I can read them in the code easily!)
mySerial.print(13, BYTE); // return character to tell vdip its end of message
delay(30000); //10 seconds to init the disk before writing (some disks may take longer)
Serial.println("finished initiating the VDIP");

}

void loop() { // run over and over again

Serial.println("start loop");

if(fileNumber < 5){ //(mySerial.available()) {
//Serial.println("serial available");
mySerial.print("OPW LOG"); // open to write creates a file - named
mySerial.print(fileNumber); // LOG%1.TXT first time round - .TXT is for the computer
mySerial.print(".TXT"); // I have used the % sign in the name so I can search the disk for log files that it has created so as not to overwrite any that may be on already
mySerial.print(13, BYTE); // return character

delay(2000);

mySerial.print("WRF "); //write to file (file needs to have been opened to write first)
mySerial.print(7); //needs to then be told how many characters will be written before clf command
mySerial.print(13, BYTE); //return to say command is finished
mySerial.print("123456"); //followed by the info to write
mySerial.print(13, BYTE); //write a return to the contents of the file (so each entry appears on a new line)
delay(2000);
mySerial.print("CLF LOG"); // it closes the file
mySerial.print(fileNumber); // LOG%1.TXT
mySerial.print(".TXT");
mySerial.print(13, BYTE); // return character

Serial.println("wrote file "+fileNumber);

fileNumber++; //so we can create other files

delay(2000);
}else{
Serial.println("finished");
//Serial.println("serial unavailable");
//delay(1000);
}
}