serial comunication

Hi guys,...
Would u help me?
I looking for a way to make my arduino-uno can received many variables from PC. 8)

Exactly I have a project that requires sending data (variables) from Delphi output to arduino, and process it on arduino. :cold_sweat:
probably 10 variables.

Please help me.......

And how are these variables formatted?

it's all parameters..
example

VS 2000
its mean VS(Viscosity standard) have a value 2000 ]:smiley:

What do you have so far?

i'm sorry... So far i try to use gobetwino, but i confused with the syntax. and its really complicated for me :cold_sweat:

Have you worked through any of the supplied examples?

Arduino does not have a split function like Processing does, SO, you need to make your own split function.
Here is something I made to help me. this will take in 3 values and change them to ints.

#include<string.h>
int X,Y,State,currentCommand=0;
String x,y,state;


// LED connected to pin 13 (on-board LED)
byte ledpin = 13;

void setup()
{
  pinMode(ledpin, OUTPUT);
  Serial.begin(9600);       // start serial communication at 9600bps
}

void loop() {
  if( Serial.available())       // if data is available to read
  { 
    digitalWrite(ledpin, HIGH); //if data is being entered
    char val= Serial.read();
    if (val == ','){
      currentCommand++; 
    }
    else {
      switch (currentCommand) { //add more case statements for more data
      case 0:
        x += val; //stores as a string
        val = ' '; //clear for new char
        break; 
      case 1:    
        y += val; //stores as a string
        val = ' ';
        break;
      case 2:    //gets the last data
        state += val; //stores as a string
        val = ' ';
        currentCommand = 0; // this only allows one char to be saved here, modify to save more.
        X=x.toInt();               //delete .toInt() if needed
        Y=y.toInt();               //delete .toInt() if needed
        State = state.toInt(); //delete .toInt() if needed
        //shows what you entered
        Serial.print(X);
        Serial.print(", ");
        Serial.print(Y);
        Serial.print(", ");
        Serial.println(State);
        
        x="";y="";state=""; //clear values
        X=0;Y=0;State=0; //clear values
        break;
      }
    }   
  }
  digitalWrite(ledpin, LOW);
}

Hope this is able to get you started.

Moderator edit: CODE TAGS dammit.

Yes... But
it doesnt work correctly. And i can't trace the error because i confused with the sintax.
maybe someone can help me with the other ways?

i can't trace the error

First mention of an error.
Care to expand?

thanks a lot HazardsMind ^^ ^^....
It really helps me:)

alva:
Yes... But it doesnt work correctly. And i can't trace the error because i confused with the sintax.
maybe someone can help me with the other ways?

Maybe you can tell us (1) what you're doing already (i.e., show us your code), (2) what you expect it to do, (3) what it's actually doing, and (4) what errors you're getting?