Hello everybody first of all, sorry of my English. I am trying to connect Arduino Mega with Mathematica 10. The Arduino Boar is programmed to read every 200 ms an analog port, print its value on the serial with the corresponding time just to make a ListPlot. I could do it with an older version of Mathematica but now I would like to use de new Serial Link library. This is the Arduino Code:
float tiempo = 0.0;
int A = 0;
void setup() {
Serial.begin(115200);
}
void loop() {
tiempo = millis()/1000.0;
int sensorValue = analogRead(A0);
if (Serial.available() > 0) {
// get incoming byte:
int letra = Serial.read();
if (letra == 'T'){
A=1;
}
if (letra == 'S'){
A=0;
}
}
if (A == 1){
Serial.print("{");
Serial.print(tiempo);
Serial.print(" , ");
Serial.print(sensorValue);
Serial.println("}");
}
delay(200);
}
The Loop starts when Mathematica writes T on the Serial and finishes when writes S on the serial Port.
Mathematica receive every data and store it, but I can't Plot beause I have problems with commas:
I have a similar code on Mathematica 9 working fine. Can you help me please?
Thanks!!!
Attachments: