# How Can I Make Logic 1 and Logic 0 graphical with Node red and RPi 3

**URL:** <https://discourse.nodered.org/t/how-can-i-make-logic-1-and-logic-0-graphical-with-node-red-and-rpi-3/1697>\
**Category:** Dashboard\
**Created:** [19 July 2018 14:40 UTC](https://discourse.nodered.org/t/how-can-i-make-logic-1-and-logic-0-graphical-with-node-red-and-rpi-3/1697 "2018-07-19T14:40:49Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [31 July 2018 13:17 UTC](https://discourse.nodered.org/t/how-can-i-make-logic-1-and-logic-0-graphical-with-node-red-and-rpi-3/1697/17 "2018-07-31T13:17:00Z")

</div>

Here is an example only with the buttons:

![pump-dsm2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/b2ba01bc9372d105bf2f21f3829dd1666e2171e7.png)

```auto
[{"id":"2805c87d.5001a8","type":"dsm","z":"895bbff8.0e6c4","name":"state right","sm_config":"{\n \"triggerInput\": \"payload\",\n \"currentState\": \"running\",\n \"states\": {\n \"stopped\": {\n \"0\": \"running\"\n },\n \"running\": {\n \"1\": \"stopped\"\n }\n },\n \"methods\": {\n \"onBeforeTransition\": \"msg.pyload = msg.payload.toString();\",\n \"0\": \"sta.fill='green';msg.background='green';msg.label='Everything is OK';\",\n \"1\": \"sta.fill='red';msg.background='grey';msg.label='grey text';\"\n }\n}","x":370,"y":720,"wires":[["e350df56.a272"]]},{"id":"1590ebfe.27c864","type":"rpi-gpio in","z":"895bbff8.0e6c4","name":"Raspberry PI 3","pin":"3","intype":"tri","debounce":"25","read":false,"x":162,"y":721,"wires":[["2805c87d.5001a8","bae279de.e744b8"]]},{"id":"bae279de.e744b8","type":"dsm","z":"895bbff8.0e6c4","name":"state left","sm_config":"{\n \"triggerInput\": \"payload\",\n \"currentState\": \"running\",\n \"states\": {\n \"stopped\": {\n \"0\": \"running\"\n },\n \"running\": {\n \"1\": \"stopped\"\n }\n },\n \"methods\": {\n \"0\": \"sta.fill='green';msg.background='grey';msg.label='grey text';\",\n \"1\": \"sta.fill='red';msg.background='red';msg.label='Warning!';\"\n }\n}","x":370,"y":800,"wires":[["eebed04e.44dab"]]},{"id":"e350df56.a272","type":"ui_button","z":"895bbff8.0e6c4","name":"","group":"c70e5b9f.5344e8","order":2,"width":0,"height":0,"passthru":false,"label":"{{msg.label}}","color":"","bgcolor":"{{msg.background}}","icon":"","payload":"","payloadType":"str","topic":"","x":550,"y":720,"wires":[[]]},{"id":"eebed04e.44dab","type":"ui_button","z":"895bbff8.0e6c4","name":"","group":"2a642b4c.f284b4","order":0,"width":0,"height":0,"passthru":false,"label":"{{msg.label}}","color":"","bgcolor":"{{msg.background}}","icon":"","payload":"","payloadType":"str","topic":"","x":550,"y":800,"wires":[[]]},{"id":"c70e5b9f.5344e8","type":"ui_group","z":"","name":"Test 1","tab":"bd8aa435.42cfb8","order":1,"disp":true,"width":"6","collapse":false},{"id":"2a642b4c.f284b4","type":"ui_group","z":"","name":"Test 2","tab":"bd8aa435.42cfb8","order":2,"disp":true,"width":"6","collapse":false},{"id":"bd8aa435.42cfb8","type":"ui_tab","z":"","name":"Monitoring System","icon":"dashboard"}]

```

---

_[View the full topic](https://discourse.nodered.org/t/how-can-i-make-logic-1-and-logic-0-graphical-with-node-red-and-rpi-3/1697)._
