I am getting a continuous signal of 5V (as shown by multimeter )I have connected a LED to ensure that. Now I want to change the voltage. Let's say 1V or 2V in order to see whether the intensity of the LED goes down or not.How should I do that ??

The LED blinks because that is what the code is telling it to do. It is rapidly ramping up and down the voltage, when this drops below the turn on voltage the LED goes out. You have no delay between each step so it looks to be going just on and off.

With this code if you delete the two lines that define outputValue and replace it with something likeOutputValue = 256 you will get a fixed output voltage.

... it all seems to work perfectly. I didn't use an LED, just a multimeter. The voltage starts off at zero, and climbs up to just over 5V, then goes down again. So the chip seems to work as you would expect it to.

The only reason for changing the delay was to slow it down enough to see the different voltages on the meter.

Please post technical questions on the forum, not by personal message. Thanks!

OK, more test data. I hooked up an "ordinary cheap" red LED to pin 8 (the output) via a 120 ohm resistor. Then the thing just seemed to freeze (the voltage didn't change). Checking the limits of the device, it seems that 25 mA is the absolute maximum rating, and it would have been drawing close to 25 mA. Changing the resistor to 1K it now worked, after a fashion. That would have drawn 3 mA at 5V (assuming a 2V forward LED voltage). Now the LED goes on and off.

However the "fading" seems to be fairly abrupt, (at around the 2V output mark). Much below 1.8V and the LED is off (which you would expect, that being its forward voltage) and above about 2.4V it seems to be on (that might partly be because of the way our eyes work).

So the sketch works, but the LED is not a very precise measuring tool.

Please post technical questions on the forum, not by personal message. Thanks!