# Node-red raspberry pi multiple input

**URL:** <https://discourse.nodered.org/t/node-red-raspberry-pi-multiple-input/8345>\
**Category:** General\
**Created:** [25 February 2019 02:48 UTC](https://discourse.nodered.org/t/node-red-raspberry-pi-multiple-input/8345 "2019-02-25T02:48:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grace1](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@Grace1](https://discourse.nodered.org/u/Grace1)\
**Post date:** [25 February 2019 02:48 UTC](https://discourse.nodered.org/t/node-red-raspberry-pi-multiple-input/8345/1 "2019-02-25T02:48:33Z")

</div>

i tryed raspberry pi gpio led control

"A" led is turned on when the "A" switch is pressed. →success

"B" led is turned on when the "B" switch is pressed. →success

If the "A" and "B" switches are simultaneously pressed, the "C" lead is turned on .→fail...

somebody help me please

 ![190225_114635598](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/7562077b158eb4863203c0d2926a03c12ecab991.jpeg) ...

---

<div class="post-metadata">

**Author:** ![Grace1](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@Grace1](https://discourse.nodered.org/u/Grace1)\
**Post date:** [25 February 2019 06:38 UTC](https://discourse.nodered.org/t/node-red-raspberry-pi-multiple-input/8345/2 "2019-02-25T06:38:03Z")

</div>

[{"id":"79f3f425.14b44c","type":"rpi-gpio out","z":"fb042b83.1102b8","name":"","pin":"37","set":"","level":"0","freq":"","out":"out","x":540,"y":180,"wires":[]},{"id":"ac4a24f8.a35c18","type":"rpi-gpio out","z":"fb042b83.1102b8","name":"","pin":"35","set":"","level":"0","freq":"","out":"out","x":540,"y":335,"wires":[]},{"id":"ebb19616.65ca18","type":"rpi-gpio out","z":"fb042b83.1102b8","name":"","pin":"33","set":"","level":"0","freq":"","out":"out","x":540,"y":475,"wires":[]},{"id":"b884dc9d.f5d9e","type":"rpi-gpio in","z":"fb042b83.1102b8","name":"","pin":"31","intype":"tri","debounce":"25","read":false,"x":530,"y":120,"wires":[["3198b12c.e5389e","79f3f425.14b44c"]]},{"id":"3f3426d3.a9a31a","type":"rpi-gpio in","z":"fb042b83.1102b8","name":"","pin":"29","intype":"tri","debounce":"25","read":false,"x":530,"y":280,"wires":[["aca97f17.b4c5","ac4a24f8.a35c18"]]},{"id":"ed65ff1f.ab887","type":"rpi-gpio in","z":"fb042b83.1102b8","name":"","pin":"23","intype":"tri","debounce":"25","read":false,"x":530,"y":420,"wires":[["ab623e01.f8393","ebb19616.65ca18"]]}]

+This is the flow I used.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [25 February 2019 09:21 UTC](https://discourse.nodered.org/t/node-red-raspberry-pi-multiple-input/8345/3 "2019-02-25T09:21:15Z")

</div>

Unfortunately your flow is not importable. Please see this for advice on how to share your flow. You can edit your previous post so that we can import it.

> [@How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506):
>
> To share code samples or flow json in this forum, you need to take care to format it properly so that it is displayed correctly. The easiest way to do that is to click the 'Preformatted Text' button in the toolbar: [image] Then paste in your code or flow json. You should end up with three back-tick characters - ``` - on their own line before and after the code. On standard US English keyboards, this is on the same key as the ~ character. Using the backticks will ens…

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [25 February 2019 12:01 UTC](https://discourse.nodered.org/t/node-red-raspberry-pi-multiple-input/8345/4 "2019-02-25T12:01:38Z")

</div>

Your flow has no logic to check if button A and B are being pressed at the same time. All you have is three gpoi-in nodes connected to three gpio-out pins.

You will need to add some logic to see if both pins are pressed and send tat to the gpio-out for LED C
