# Led turn immediately

**URL:** <https://forum.xod.io/t/led-turn-immediately/6955>\
**Category:** Uncategorized\
**Created:** [September 25, 2024, 8:06pm UTC](https://forum.xod.io/t/led-turn-immediately/6955 "2024-09-25T20:06:17Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![apsolucija](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@apsolucija](https://forum.xod.io/u/apsolucija)\
**Post date:** [September 25, 2024, 8:06pm UTC](https://forum.xod.io/t/led-turn-immediately/6955/1 "2024-09-25T20:06:17Z")

</div>

hi, the code works great for me, but I would like it to turn off immediately when D6 is true, but now it turns off as well as when it starts, fade slowly, I’m interested in how to do it…

 ![gw](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/1/16aa5945e7c19f1d15187f6b3f276653030e1fea.png)

---

<div class="post-metadata">

**Author:** ![nazarijtipusak080](https://avatars.discourse-cdn.com/v4/letter/n/7c8e57/32.png) [@nazarijtipusak080](https://forum.xod.io/u/nazarijtipusak080)\
**Post date:** [September 26, 2024, 3:30am UTC](https://forum.xod.io/t/led-turn-immediately/6955/2 "2024-09-26T03:30:48Z")

</div>

Hi! The faded node works for both fading and rising. You can use the animation-unit node, which is more flexible and has direct transitions to 1 and 0.

---

<div class="post-metadata">

**Author:** ![apsolucija](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@apsolucija](https://forum.xod.io/u/apsolucija)\
**Post date:** [September 26, 2024, 9:52am UTC](https://forum.xod.io/t/led-turn-immediately/6955/3 "2024-09-26T09:52:34Z")

</div>

I struggle for hours, but I can’t manage to make it turn on slowly and the D6 turns it off immediately, even though that NOD is also new to me…

---

<div class="post-metadata">

**Author:** ![nazarijtipusak080](https://avatars.discourse-cdn.com/v4/letter/n/7c8e57/32.png) [@nazarijtipusak080](https://forum.xod.io/u/nazarijtipusak080)\
**Post date:** [September 26, 2024, 3:32pm UTC](https://forum.xod.io/t/led-turn-immediately/6955/4 "2024-09-26T15:32:38Z")

</div>

Describe how your code should work, then I’ll try to help you)

---

<div class="post-metadata">

**Author:** ![apsolucija](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@apsolucija](https://forum.xod.io/u/apsolucija)\
**Post date:** [September 26, 2024, 4:28pm UTC](https://forum.xod.io/t/led-turn-immediately/6955/5 "2024-09-26T16:28:28Z")

</div>

when D3 or D4 is active and D6 is not, the D5 LED lights up immediately and that’s ok, and if I don’t light the D6 pin, the D5 LED will turn off slowly, that’s why it’s on the “if else” node on the “F” “fade” node. But if the light is on D5 while it is on, I would like that when D6 becomes active, the D5 LED should turn off immediately without fading. And otherwise, fade in and fade off should be when D6 is turned off.

I hope it’s clear, it can be an example on a regular led and button or a digital input, some simplified version for an example if you know, thanks in advance.

---

<div class="post-metadata">

**Author:** ![nazarijtipusak080](https://avatars.discourse-cdn.com/v4/letter/n/7c8e57/32.png) [@nazarijtipusak080](https://forum.xod.io/u/nazarijtipusak080)\
**Post date:** [September 26, 2024, 5:15pm UTC](https://forum.xod.io/t/led-turn-immediately/6955/6 "2024-09-26T17:15:46Z")

</div>

Tried adding another if-else and activating it via D6. On the real “0”. Why use delay instead of debounce ?

---

<div class="post-metadata">

**Author:** ![apsolucija](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@apsolucija](https://forum.xod.io/u/apsolucija)\
**Post date:** [September 26, 2024, 6:07pm UTC](https://forum.xod.io/t/led-turn-immediately/6955/7 "2024-09-26T18:07:14Z")

</div>

I honestly don’t know how to fit in the second “if else” and how to connect it…

And what would you get better with a “debounce” node?

---

<div class="post-metadata">

**Author:** ![nazarijtipusak080](https://avatars.discourse-cdn.com/v4/letter/n/7c8e57/32.png) [@nazarijtipusak080](https://forum.xod.io/u/nazarijtipusak080)\
**Post date:** [September 26, 2024, 6:39pm UTC](https://forum.xod.io/t/led-turn-immediately/6955/8 "2024-09-26T18:39:50Z")

</div>

If you want to keep everything as it is, then just add another if-else between led d5 and if-else. Apply “0” to its T and connect F to the output of the previous if-else. As for feeding the signal from d6 to our new if-else, do it via a “flip-flop” node. When dialing, we send a signal from d6 to “set”, a signal to “reset” you can send either from “any” of d3 and d4, or again from d6, but with a time delay (at the same time, use the ready output of the new node delays instead of ACT )

---

<div class="post-metadata">

**Author:** ![apsolucija](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@apsolucija](https://forum.xod.io/u/apsolucija)\
**Post date:** [September 26, 2024, 7:23pm UTC](https://forum.xod.io/t/led-turn-immediately/6955/9 "2024-09-26T19:23:10Z")

</div>

I really don’t understand what I need, you confused me…can you show it with some simple example…

 ![Snimka zaslona 2024-09-26 212122](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/f/fb2ee29bf66637e500b43eabc697bcc4f89c7bca.png)

---

<div class="post-metadata">

**Author:** ![apsolucija](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@apsolucija](https://forum.xod.io/u/apsolucija)\
**Post date:** [September 26, 2024, 7:35pm UTC](https://forum.xod.io/t/led-turn-immediately/6955/10 "2024-09-26T19:35:27Z")

</div>

for example, in this example, when D3 is active it turns on immediately and when it turns off slowly, but I need that if D4 is active within, say, 10 seconds, it turns on immediately without slow turning off. How can I do that?

 ![Snimka zaslona 2024-09-26 213124](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/3/3b130aa2b30534129239a0fcadbc14a23349eb32.png)

---

<div class="post-metadata">

**Author:** ![nazarijtipusak080](https://avatars.discourse-cdn.com/v4/letter/n/7c8e57/32.png) [@nazarijtipusak080](https://forum.xod.io/u/nazarijtipusak080)\
**Post date:** [September 26, 2024, 8:03pm UTC](https://forum.xod.io/t/led-turn-immediately/6955/11 "2024-09-26T20:03:01Z")

</div>

Now I don’t have a computer nearby to make a diagram for you. I will try to create an example for you tomorrow)

---

<div class="post-metadata">

**Author:** ![nazarijtipusak080](https://avatars.discourse-cdn.com/v4/letter/n/7c8e57/32.png) [@nazarijtipusak080](https://forum.xod.io/u/nazarijtipusak080)\
**Post date:** [September 27, 2024, 8:44am UTC](https://forum.xod.io/t/led-turn-immediately/6955/12 "2024-09-27T08:44:45Z")

</div>

[example11.xodball](https://forum.xod.io/uploads/short-url/3v9zsdK55rYEPlipQ15obWMjgEf.xodball) (11.0 KB)

---

<div class="post-metadata">

**Author:** ![nazarijtipusak080](https://avatars.discourse-cdn.com/v4/letter/n/7c8e57/32.png) [@nazarijtipusak080](https://forum.xod.io/u/nazarijtipusak080)\
**Post date:** [September 27, 2024, 8:53am UTC](https://forum.xod.io/t/led-turn-immediately/6955/13 "2024-09-27T08:53:29Z")

</div>

This is a modified version of the first photo. I hope you will understand what has been done. Instead of configurable nodes, put your own buttons and LEDs. Good luck!

---

<div class="post-metadata">

**Author:** ![apsolucija](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@apsolucija](https://forum.xod.io/u/apsolucija)\
**Post date:** [September 27, 2024, 6:38pm UTC](https://forum.xod.io/t/led-turn-immediately/6955/14 "2024-09-27T18:38:33Z")

</div>

wow, this is ok now, I entered it in my sketch (attachment), the only thing I lost (maybe because of “debounce”, I don’t know) is that my D6 has a delay of say 10 seconds before it turns on and turns off immediately or in say 2 when D9 is no longer active, to be able to adjust…

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/e/e82ef8c7e1706632b63d6bedda92b393d037267d.png)

---

<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:** [October 27, 2024, 6:39pm UTC](https://forum.xod.io/t/led-turn-immediately/6955/15 "2024-10-27T18:39:01Z")

</div>

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