Help on "analogWrite()"

Hello there,

I am a little bit confused with the "analogWrite()" function. On the reference, it is written:

Syntax analogWrite(pin, value) Parameters pin: the pin to write to. value: the duty cycle: between 0 (always off) and 255 (always on).

Thus, I don't understand what should be the "value" parameter since it says here that it is a duty cycle but in the example bellow, it is just a value.

The analogWrite() is in fact a pulse stream which is part of the time HIGH (5V) and part of the time LOW (0V). The amount of HIGH moments can be 0 (0%HIGH) .. 255 (100% HIGH) . The percentage HIGH is called the duty cycle.

Thanks, I understand better now. Thus, the delivered value is an average of that. I have to check if this could be an issue with what I have to power. Also, is there a board which can deliver a constant tension that could be changed?

you should have a look at a low pass RC filter or use an DAC chip