I'm trying to write a small program that works and then transform that into my bigger program (used to measure atmospheric data).
I'm using an Arduino Mega 2560. I using a FTDI VDIP1 to hold my flash drive in which I'm writing data to. I am utilizing my serial ports on my arduino and have them wired to the VDIP1. The connections:
5V
ground
A0 to RX1
A1 to TX1
The code is as follows:
void setup() {
Serial1.begin(9600);
Serial.begin(57600);
char letter;
int noOfChars;
noOfChars +=2;
letter='A';
//Tells the USB Module to use ASCII numbers, so the output is human-readable.
Serial1.print("IPA");
Serial1.print(13, BYTE);
//Open a file for writing data.
Serial1.print("OPW DATA.TXT");
Serial1.print(13, BYTE);
//Write a header to the file
Serial1.print("WRF ");
Serial1.print(noOfChars);
Serial1.print(13, BYTE);
Serial1.print(letter);
Serial1.print(13, BYTE);
Serial1.print("CLF DATA.TXT");
Serial1.print(13, BYTE);
Serial.println("Wrote to file");
}
void loop() {
}
I tried using this as a guide:
http://www.arduino.cc/playground/Main/UsbMemory
Is there any information you need from my end to diagnose the problem?
The problem right now is that no file is made at all on the USB drive. Any ideas to solve this problem?