# Serial write char larger than 127

**URL:** https://discourse.processing.org/t/serial-write-char-larger-than-127/15449
**Category:** Electronics (Arduino, etc.)
**Created:** [November 13, 2019, 6:45am UTC](https://discourse.processing.org/t/serial-write-char-larger-than-127/15449 "2019-11-13T06:45:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![pandl](https://avatars.discourse-cdn.com/v4/letter/p/35a633/32.png) [@pandl](https://discourse.processing.org/u/pandl)
#### Post date: [November 13, 2019, 6:45am UTC](https://discourse.processing.org/t/serial-write-char-larger-than-127/15449/1 "2019-11-13T06:45:13Z")

</div>

Thank you for reading this.

I’ve been playing with the g4p text box and the knob to send serial data to an Arduino but have run into a problem with char values larger than 127. Is there another method to serial write int values? I know that 170 is beyond what a char value can be.

This what I’m doing:

```auto
  int my_value = knob1.getValueI();
    
  myPort.write(char(my_value)); 

```

In this case the int my\_value can be between 10 and 170.

---

<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: [November 13, 2019, 7:48am UTC](https://discourse.processing.org/t/serial-write-char-larger-than-127/15449/2 "2019-11-13T07:48:15Z")

</div>

i told you in your last question:

```auto
what i want to say is stay on the ( easy diagnostic ) ASCII level
until there is no other way as to write byte stream / own protocol …

```

means:

write a arduino program where you  
also from the arduino IDE monitor can send type  
multi character ASCII TEXT in a LINE (CR LF )

```auto
 1000

```

and the arduino catch that whole String and makes a number again out of it.

* * *

if stay on one byte / character level will be ever restricted to that understanding  
and that is different processing and Arduino…  
run:

```auto
  println( "byte "+Byte.SIZE+ " bit | min: "+Byte.MIN_VALUE+ "\t\t\t max: "+Byte.MAX_VALUE);

```

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [November 22, 2019, 3:44pm UTC](https://discourse.processing.org/t/serial-write-char-larger-than-127/15449/3 "2019-11-22T15:44:46Z")

</div>

Possibly a relevant Arduino + Processing example – the final post on this thread:

[Serial write of byte \> 127](https://forum.arduino.cc/index.php?topic=403895.msg2780365#msg2780365)
