# Problem with split() and serialEvent

**URL:** <https://discourse.processing.org/t/problem-with-split-and-serialevent/20757>\
**Category:** Electronics (Arduino, etc.)\
**Created:** [May 11, 2020, 8:33pm UTC](https://discourse.processing.org/t/problem-with-split-and-serialevent/20757 "2020-05-11T20:33:05Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [May 12, 2020, 12:32am UTC](https://discourse.processing.org/t/problem-with-split-and-serialevent/20757/2 "2020-05-12T00:32:18Z")

</div>

> [@Ablah](#):
>
> The first problem I encounter is that I can’t see the values on the console even if I print them.

Try this right after you receive string:  
println(inString);

Try a delay() in setup() of Processing:

> [@Processing to Arduino Serial Library Example](https://discourse.processing.org/t/processing-to-arduino-serial-library-example/11143):
>
> The SimpleWrite example in the Processing examples was not working on PCs I had available to me. The Arduino resets when establishing a serial connection. I added a delay(1000) to allow the Arduino to reset after serial connection to Processing and it now works. I modified the Processing setup() as follows: void setup() { size(200, 200); printArray(Serial.list()); //Added! List all the available serial ports String portName = Serial.list()[0]; myPort = new Serial(this, portNa…

I like to test code on receiving side with simulated data:

```auto
String s = "113,206,46,212,102,195,211,114,33," + "\n";

print(s);

s = s.trim(); // Trims that \n before processing string

print(s);
println();

println(s);

String [] splitData = split(s, ',');

printArray(splitData);
printArray(float (splitData));

println(float(splitData[0]));

float [] splitFloats = float(split(s, ','));

printArray(splitFloats);

```

`:)`

---

_[View the full topic](https://discourse.processing.org/t/problem-with-split-and-serialevent/20757)._
