Multiple arduino inputs

It is still incorrect.

Corrections to code you provided and also tested and working:

Arduino:

int value[3];
int count;

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

void loop()
  {
  //value[0] = analogRead(A0);
 // value[1] = analogRead(A1);
  //value[2] = analogRead(A2); 

  //Test values
  value[0] = count;
  value[1] = count+10;
  value[2] = count+20;
  count++;

  Serial.println(String(value[0]) + "split" + String(value[1]) + "split" + String(value[2]));
  
  delay(100);
  }

Processing:

import processing.serial.*;

Serial myPort;
String val;

void setup()
  {
  printArray(Serial.list());  
  String portName = Serial.list()[2];
  myPort = new Serial(this, portName, 9600);
  }

void draw() 
  {
  if ( myPort.available() > 0) 
    {  
    val = myPort.readStringUntil('\n');
    if (val!= null)
      {
      val = trim(val);  
      intVals = int(split(val, "split"));
       
      println(val);
      printArray(intVals);    
      }
    }
  }

:slight_smile:

2 Likes