# Showing buttons based on a message received by arduino

**URL:** https://discourse.processing.org/t/showing-buttons-based-on-a-message-received-by-arduino/22235
**Category:** Electronics (Arduino, etc.)
**Created:** [June 29, 2020, 4:33am UTC](https://discourse.processing.org/t/showing-buttons-based-on-a-message-received-by-arduino/22235 "2020-06-29T04:33:58Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)
#### Post date: [June 30, 2020, 8:24am UTC](https://discourse.processing.org/t/showing-buttons-based-on-a-message-received-by-arduino/22235/10 "2020-06-30T08:24:16Z")

</div>

> [@mohitSingh](#):
>
> … as I wanted a tri-state variable…

Indeed the `boolean` primitive datatype can be either `true` or `false`:

> **[boolean / Reference](https://processing.org/reference/boolean.html)**
>
> Datatype for the Boolean values true and false. It is common to use boolean values with control statements to determine the flow of a program. The first time a variable is written…

`boolean received; // defaults to false`

For a 3rd state you can use a Boolean type instead, which can be `null` in addition to `true` or `false`:  
[Docs.Oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Boolean.html](http://Docs.Oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Boolean.html)  
`Boolean received; // defaults to null`

---

_[View the full topic](https://discourse.processing.org/t/showing-buttons-based-on-a-message-received-by-arduino/22235)._
