Arduino - Processing - csv file

Hi all!

i've been trying for days to figure out how the Processing language works and i just can't get it! I' ve gone through all the examples and the previous posts here but i still can't make it work. Only PLX DAQ worked fine, but it does not save automatically, so i cannot use it.

So, I have this sketch:

int Vnorm = 0;
int R = 0;
int row = 0;

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
//Serial.println("CLEARDATA");
//Serial.println("LABEL,Date,Time,Thermokrasia,Antistasi");
}

void loop() {
// put your main code here, to run repeatedly:

int R_0 = 100;
int R_1 = 220;

int Vunnorm = analogRead(A0);
float Vnorm = Vunnorm * (3.3 / 1023.0);
float R = (R_1 * Vnorm) / ( 3.3 - Vnorm);
//Serial.println(R);
//Serial.println(Vnorm);
float x = sqrt(15.27481 + 2.31 * (1.0 - R/100.0));
float T = 1000.0 * (3.9083 - x) / 1.155;
Serial.println(T);

delay(2000);

}

It measuers a voltage and figures out the temperature, by using a PT100 sensor. I will add six more sensors and another volatge measurement later or, this is gonna be pretty straightforward. Now, what i want is to create a csv file that will contain all the measurements and its name will be the date and time. I need some help pleeeeease.

The is a Processing question, not an Arduino question. You can get some help on this sort of thing in the "Interfacing w/software on the Computer" section of the Arduino forum, but a Processing forum would be a better place to ask for help specific to Processing.

If your PC is running Windows then you also have the option of using Gobetwino to write to the CSV file, instead of using Processing. Processing can certainly do it, though.

...what i want is to create a csv file that will contain all the measurements and its name will be the date and time.

Gee, you could do this so much easier...

  • use a USB-ttl serial and then a terminal program to write the log,
  • use HID to a Processing sketch
  • use HID directly into Excel, etc.

http://www.hackster.io/rayburne/analog-digital-port-viewer-usb
http://www.hackster.io/rayburne/arduino-to-excel-using-v-usb

The source code by author-of-record for the compiled Processing terminal is in my Credits section of 1st link.

Good luck,

Ray