Led with fade effect

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.

1 Like

Here is one of many ways to do this:

image

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).

3 Likes

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