# Need help decoding incoming byte

**URL:** <https://discourse.processing.org/t/need-help-decoding-incoming-byte/27644>\
**Category:** Electronics (Arduino, etc.)\
**Created:** [February 7, 2021, 2:11am UTC](https://discourse.processing.org/t/need-help-decoding-incoming-byte/27644 "2021-02-07T02:11:13Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [February 9, 2021, 4:40am UTC](https://discourse.processing.org/t/need-help-decoding-incoming-byte/27644/6 "2021-02-09T04:40:59Z")

</div>

> [@HackinHarry](#):
>
> ` inByte[0] = myPort.read();`

hints

> [@Problem with split() and serialEvent](https://discourse.processing.org/t/problem-with-split-and-serialevent/20757/2):
>
> Try this right after you receive string: println(inString); Try a delay() in setup() of Processing: I like to test code on receiving side with simulated data: 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, ',')); print…

> [@Issue with using array after splitTokens()](https://discourse.processing.org/t/issue-with-using-array-after-splittokens/10826):
>
> Hello. This can be considered an extension of my previous thread here [Using two different readStringUntil "characters"](https://discourse.processing.org/t/using-two-different-readstringuntil-characters/10769) Now, I am working on a basic Arduino project, but for understand Processing, I am now using a potentiometer to extend a line across the screen. I wish to extend it to 2D because it has been 1D Through Serial, I receive the values of the pot via Arduino. I know that separating a string using splitTokens() will give a pre-initialized array at some index that string. However he…

> [@Using two different readStringUntil "characters"](https://discourse.processing.org/t/using-two-different-readstringuntil-characters/10769/5):
>
> 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: 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 …

---

_[View the full topic](https://discourse.processing.org/t/need-help-decoding-incoming-byte/27644)._
