# Trouble with the Serial port read

**URL:** <https://discourse.processing.org/t/trouble-with-the-serial-port-read/10724>\
**Category:** Electronics (Arduino, etc.)\
**Created:** [April 28, 2019, 6:26pm UTC](https://discourse.processing.org/t/trouble-with-the-serial-port-read/10724 "2019-04-28T18:26:55Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [April 30, 2019, 6:22am UTC](https://discourse.processing.org/t/trouble-with-the-serial-port-read/10724/4 "2019-04-30T06:22:46Z")

</div>

still using trim and match can make it better,  
add

```auto
 if ( list.length >=5 ) {
      MACH_ID= list [0];
      PeriodMillis = list [1];
      Channel = list [2];
      Operator= list [3];
      MoreInfo = list [4];
    } else println("lost line: "+IncomingSTR);

```

---

_[View the full topic](https://discourse.processing.org/t/trouble-with-the-serial-port-read/10724)._
