# Led with fade effect

**URL:** <https://forum.xod.io/t/led-with-fade-effect/2329>\
**Category:** Uncategorized\
**Created:** [June 10, 2019, 7:30pm UTC](https://forum.xod.io/t/led-with-fade-effect/2329 "2019-06-10T19:30:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nono007](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@nono007](https://forum.xod.io/u/nono007)\
**Post date:** [June 10, 2019, 7:30pm UTC](https://forum.xod.io/t/led-with-fade-effect/2329/1 "2019-06-10T19:30:15Z")

</div>

Hi everybody , I just discovered this awesome software today, but I’m a real newbie. Excuse me for the stupid question but I just want to make a led that goes off and comes back with a gradual effect. I used some nodes ; led, fade, delay , but nothing works.  
thanks for you help.

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [June 10, 2019, 10:00pm UTC](https://forum.xod.io/t/led-with-fade-effect/2329/2 "2019-06-10T22:00:18Z")

</div>

Here is one of many ways to do this:

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

Note that you will need to change the led-PORT pin to the physical port you connected your LED to. The LED should be wired from this port, through a resistor (to keep it and Arduino from burning out), and to ground. If LED never lights, try turning it around; it will only allow electric to flow one way through it. If you have used LED without a resistor, try a new one since you may have burned it out. In order to control brightness of LED, it will need to be wired to a port that supports PWM (Pulse Width Modulation). My board marks those pins with a ~; yours may be different. The built-in LED is usually wired to a pin that does not support PWM (you can turn it on and off using digital-write, but you cannot dim it using “led” node).

---

<div class="post-metadata">

**Author:** ![nono007](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@nono007](https://forum.xod.io/u/nono007)\
**Post date:** [June 11, 2019, 1:28am UTC](https://forum.xod.io/t/led-with-fade-effect/2329/3 "2019-06-11T01:28:27Z")

</div>

Thank you very much Gweimer for this code , and thanks also for the explanations. it works perfectly with the arduino uno, but not with the nano. I tried with pins D11 D9 and D10, or, maybe I have a bad copy of a Nano for the PWM (Pulse Width Modulation) ?! [introduction-to-arduino-nano-13-1|690x370](https://forum.xod.io/uploads/short-url/sDa9jYYUazRtpU1S5Kr7LOOkhpq.png)
