# Button works opposit

**URL:** <https://forum.xod.io/t/button-works-opposit/838>\
**Category:** Uncategorized\
**Created:** [June 8, 2018, 2:44pm UTC](https://forum.xod.io/t/button-works-opposit/838 "2018-06-08T14:44:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![peen64](https://avatars.discourse-cdn.com/v4/letter/p/5e9695/32.png) [@peen64](https://forum.xod.io/u/peen64)\
**Post date:** [June 8, 2018, 2:44pm UTC](https://forum.xod.io/t/button-works-opposit/838/1 "2018-06-08T14:44:14Z")

</div>

Hello

When i upload the button code with de Arduino Ide  
Its working correct.  
But when i upload that with Xod IT works the other way around .  
Output is on when button unpressed and off when button is pressed.  
What is going wrong?  
The input is connected well.  
And i used the example from Xod.

Ton

---

<div class="post-metadata">

**Author:** ![nkrkv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/nkrkv/32/8_2.png) [@nkrkv](https://forum.xod.io/u/nkrkv)\
**Post date:** [June 8, 2018, 3:13pm UTC](https://forum.xod.io/t/button-works-opposit/838/2 "2018-06-08T15:13:38Z")

</div>

Hello and welcome?

What button component do you use? Can you provide the exact patch you use and a photo/schematics of your circuit?

---

<div class="post-metadata">

**Author:** ![peen64](https://avatars.discourse-cdn.com/v4/letter/p/5e9695/32.png) [@peen64](https://forum.xod.io/u/peen64)\
**Post date:** [June 8, 2018, 6:51pm UTC](https://forum.xod.io/t/button-works-opposit/838/3 "2018-06-08T18:51:37Z")

</div>

Hello i use this patch  
[https://xod.io/docs/tutorial/15-buttons/](https://xod.io/docs/tutorial/15-buttons/)  
And this wiring  
[https://www.arduino.cc/en/Tutorial/Button](https://www.arduino.cc/en/Tutorial/Button)  
And dont worry i use a make button no break  
The wiring is correct because this i my work.

Greetings  
Ton

---

<div class="post-metadata">

**Author:** ![nkrkv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/nkrkv/32/8_2.png) [@nkrkv](https://forum.xod.io/u/nkrkv)\
**Post date:** [June 9, 2018, 4:29pm UTC](https://forum.xod.io/t/button-works-opposit/838/4 "2018-06-09T16:29:01Z")

</div>

The scheme you use pulls the button _down_ to ground and XOD expects a pull up to Vcc. That’s the difference leading to the inversion. Look carefully: what the signal will be when the button is released? It will go to ground through the resistor on your scheme:

![button_schem](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/7199cd0c99c0706827905691fbac658a354ee2ad.png)

And it goes to 5V in the scheme recommended in the tutorial:

 ![fz](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/0a47f3a335d8a69d4ae8ed412d66dad0f68c2d6b.png)

Use the wiring scheme from the XOD tutorial or place a `xod/core/not` node below the `button` output.

---

<div class="post-metadata">

**Author:** ![peen64](https://avatars.discourse-cdn.com/v4/letter/p/5e9695/32.png) [@peen64](https://forum.xod.io/u/peen64)\
**Post date:** [June 9, 2018, 7:03pm UTC](https://forum.xod.io/t/button-works-opposit/838/5 "2018-06-09T19:03:58Z")

</div>

Ok my mistake  
Thanks for your reply 👍

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/eb7348baa04192c2ef932d1db54d44f09f8a7888.png) [@system](https://forum.xod.io/u/system)\
**Post date:** [June 13, 2018, 8:11am UTC](https://forum.xod.io/t/button-works-opposit/838/6 "2018-06-13T08:11:06Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
