# Using two different readStringUntil "characters"

**URL:** <https://discourse.processing.org/t/using-two-different-readstringuntil-characters/10769>\
**Category:** Electronics (Arduino, etc.)\
**Tags:** homework\
**Created:** [April 29, 2019, 11:10pm UTC](https://discourse.processing.org/t/using-two-different-readstringuntil-characters/10769 "2019-04-29T23:10:54Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![eezJerome](https://avatars.discourse-cdn.com/v4/letter/e/e0b2c6/32.png) [@eezJerome](https://discourse.processing.org/u/eezJerome)\
**Post date:** [April 30, 2019, 10:54am UTC](https://discourse.processing.org/t/using-two-different-readstringuntil-characters/10769/5 "2019-04-30T10:54:00Z")

</div>

Well, I was lost after the first 3 replies, however I think I can use an array and index the place of it

Like maybe:

```auto
float val[2];
int index = 0;

//given that we are already reading from serial port called "port"...
...
void func(){ //not sure which real function to put in the real code
  input = port.readStringUntil('\n');
  val[index] = input;
  index = index + 1;
  input = port.readStringUntil('\n');
  val[index] = input;
  index = index + 1;
   if (index > 1){
    index = 0;
  }
  pxval = val[0];
  pyval = val[1];
}

...
//another external function here
void draw(){
  background(1);
  stroke(255);
  line(pxval, pyval, val[0], val[1]);
}
```

Note: being new to Processing and coming from a slight Arduino background, I am still learning.

Another note: I had no time to read the reply you gave, as well as the whole question, due to me having a load of schoolwork. Apologies for any incompetence.

EDIT: I have read a bit of the link within the one you sent me:

> **[Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/14988/drawing-of-graphs-from-i2c-imu#Item_7)**
>
> Processing is an electronic sketchbook, a language and a worldwide community. This is its forum.

I think within my arduino code I should output the accelerometer values with a [0] or [1] appended to it, and from there use readStingUntil. I hope this is solved; I will do some testing but for the meantime if there are any errors you can see, please get back to me

Thank you

---

_[View the full topic](https://discourse.processing.org/t/using-two-different-readstringuntil-characters/10769)._
