Skip to main content
Added C++ language formatting tag.
Source Link
Nick Gammon
  • 38.9k
  • 13
  • 70
  • 127

My name is carlos

Is possible the communication between several arduinosArduinos to one serial port in the PC ?

  

If I have ARD_A, ARD_B,... ARD_Z running with some code like this

void setup()
{
    Serial.begin(9600);
}

void loop()
{
    while (Serial.available() > 0)
    {
       String stringID = Serial.read()
       int nFound = stringID.indexOf("@ARD_01"); 
                    // ---> Id is unique for each arduino
       if ( nFound > 0 )
          Serial.print("this is @ARD_01 responding sending some data");
     }
}
void setup()
{
    Serial.begin(9600);
}

void loop()
{
    while (Serial.available() > 0)
    {
       String stringID = Serial.read()
       int nFound = stringID.indexOf("@ARD_01"); 
                    // ---> Id is unique for each arduino
       if ( nFound > 0 )
          Serial.print("this is @ARD_01 responding sending some data");
     }
}

andAnd in the pc there is an exe sending a string "@ARD_01 I want your data" process the data "@ARD_02 I want your data" process the data "@ARD_03 I want your data" process the data:

"@ARD_01 I want your data" 
   process the data
"@ARD_02 I want your data" 
   process the data
"@ARD_03 I want your data" 
   process the data

My name is carlos

Is possible the communication between several arduinos to one serial port in the PC ?

 

If I have ARD_A, ARD_B,... ARD_Z running with some code like this

void setup()
{
    Serial.begin(9600);
}

void loop()
{
    while (Serial.available() > 0)
    {
       String stringID = Serial.read()
       int nFound = stringID.indexOf("@ARD_01"); 
                    // ---> Id is unique for each arduino
       if ( nFound > 0 )
          Serial.print("this is @ARD_01 responding sending some data");
     }
}

and in the pc there is an exe sending a string "@ARD_01 I want your data" process the data "@ARD_02 I want your data" process the data "@ARD_03 I want your data" process the data

Is possible the communication between several Arduinos to one serial port in the PC ?

 

If I have ARD_A, ARD_B,... ARD_Z running with some code like this

void setup()
{
    Serial.begin(9600);
}

void loop()
{
    while (Serial.available() > 0)
    {
       String stringID = Serial.read()
       int nFound = stringID.indexOf("@ARD_01"); 
                    // ---> Id is unique for each arduino
       if ( nFound > 0 )
          Serial.print("this is @ARD_01 responding sending some data");
     }
}

And in the pc there is an exe sending a string:

"@ARD_01 I want your data" 
   process the data
"@ARD_02 I want your data" 
   process the data
"@ARD_03 I want your data" 
   process the data
added 64 characters in body
Source Link
Majenko
  • 105.9k
  • 5
  • 82
  • 139

My name is carlos

Is possible the communication between several arduinos to one serial port in the PC ?

If I have ARD_A, ARD_B,... ARD_Z running with some code like this

void setup() { Serial.begin(9600); }

void loop() { while (Serial.available() > 0) { String stringID = Serial.read() int nFound = stringID.indexOf("@ARD_01"); // ---> Id is unique for each arduino if ( nFound > 0 ) Serial.print("this is @ARD_01 responding sending some data"); } }

void setup()
{
    Serial.begin(9600);
}

void loop()
{
    while (Serial.available() > 0)
    {
       String stringID = Serial.read()
       int nFound = stringID.indexOf("@ARD_01"); 
                    // ---> Id is unique for each arduino
       if ( nFound > 0 )
          Serial.print("this is @ARD_01 responding sending some data");
     }
}

and in the pc there is an exe sending a string "@ARD_01 I want your data" process the data "@ARD_02 I want your data" process the data "@ARD_03 I want your data" process the data

My name is carlos

Is possible the communication between several arduinos to one serial port in the PC ?

If I have ARD_A, ARD_B,... ARD_Z running with some code like this

void setup() { Serial.begin(9600); }

void loop() { while (Serial.available() > 0) { String stringID = Serial.read() int nFound = stringID.indexOf("@ARD_01"); // ---> Id is unique for each arduino if ( nFound > 0 ) Serial.print("this is @ARD_01 responding sending some data"); } }

and in the pc there is an exe sending a string "@ARD_01 I want your data" process the data "@ARD_02 I want your data" process the data "@ARD_03 I want your data" process the data

My name is carlos

Is possible the communication between several arduinos to one serial port in the PC ?

If I have ARD_A, ARD_B,... ARD_Z running with some code like this

void setup()
{
    Serial.begin(9600);
}

void loop()
{
    while (Serial.available() > 0)
    {
       String stringID = Serial.read()
       int nFound = stringID.indexOf("@ARD_01"); 
                    // ---> Id is unique for each arduino
       if ( nFound > 0 )
          Serial.print("this is @ARD_01 responding sending some data");
     }
}

and in the pc there is an exe sending a string "@ARD_01 I want your data" process the data "@ARD_02 I want your data" process the data "@ARD_03 I want your data" process the data

Source Link

serial communication between several arduinos to pc

My name is carlos

Is possible the communication between several arduinos to one serial port in the PC ?

If I have ARD_A, ARD_B,... ARD_Z running with some code like this

void setup() { Serial.begin(9600); }

void loop() { while (Serial.available() > 0) { String stringID = Serial.read() int nFound = stringID.indexOf("@ARD_01"); // ---> Id is unique for each arduino if ( nFound > 0 ) Serial.print("this is @ARD_01 responding sending some data"); } }

and in the pc there is an exe sending a string "@ARD_01 I want your data" process the data "@ARD_02 I want your data" process the data "@ARD_03 I want your data" process the data