reading analog input + PLX-DAQ

Hi

i found sample code regarding to PLX-DAQ

but i dont know how to combine the code with analog reading on A0 pin of ARDUINO.

how can i add analog reading A0 address to the code so that i will import data from ARDUINO ?

This is the basic code of PLX-DAQ

int x = 0;
int row = 0;
void setup() {
Serial.begin(128000); // opens serial port, sets data rate to 9600 bps
Serial.println(“CLEARDATA”);
Serial.println(“LABEL,Time,x,sin(x)”);
}

void loop() {
Serial.print(“DATA,TIME,”); Serial.print(x); Serial.print(","); Serial.println(sin(x*PI/180));
row++;
x++;
if (row > 360)
{
row=0;
Serial.println(“ROW,SET,2”);
}
delay(100);
}

I would question the timing and baud rate in the code you post but, if it works, it works. I assume it graphs two values, x and the sine thereof, against time.

The example AnalogInOutSerial in the IDE might be what you want. It might be easier to grasp if, instead of trying to integrate the analogue reading into the PLX example, you just use the PLX methodology to print the data from the analogue programme.

thanks for your suggestion :)

i write the code but it seems it doesnt work.

No data label column, row seem on the excel.

i downloaded the code into the arduino and there is no problem with compiling the program.

int SensorValue = A0 ;

int row = 0 ;

void setup() {

Serial.begin(128000) ;// Opens serial port , set data rate to 9600 bps

Serial.println("CLEARDATA " );

Serial.println("LABEL,TIME,LDR_Read");// put your setup code here, to run once:

}

void loop() {

int AnalogReading = analogRead(SensorValue);// read the input on analog pin 0:

float voltage = AnalogReading * (5.0 / 1023.0);// Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):

Serial.print("DATA , TIME , ");

Serial.println(voltage);

row++ ;

AnalogReading ++;

voltage ++;

delay (100);

// wait 2 miliseconds before the next loop for the ADC to settle after the last reading.

}

crea123: Serial.begin(128000) ;// Opens serial port , set data rate to 9600 bps ..........................

delay (100);

// wait 2 miliseconds before the next loop for the ADC to settle after the last reading.

What version of Excel are you using?

Do you get a readable reading on the serial monitor?

http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2PLX.pdf

AnalogReading ++;

  voltage ++;

My terminal monitor acts weird when I used 128000 so I changed it to 9600

in your code you want to monitor the A0

you do not need

AnalogReading ++;

  voltage ++;

in your previous example you test the row if it is > 360 after you do row++

if it is larger than 360 the row is resetted to 0

but in the code you wrote

you just increase the row but you never do anything about it

@ Nick_Pyner I put a sensor to A0 and I can monitor it and see all the changes on my serial mon

too bad I do not have excel on this PC i cannot try this amazing programme