Arduino, ESP8266 and ESP32 can mimick an analog output voltage though PWM via their digital pins. The duty cycle of the PWM output can be controlled via the analogWrite command with the value parameter in the range ![Math $[0, 255]$](/lib/exe/fetch.php?media=wiki:latex:/img408cfa4dc2c7578d79497ff3c9a310e6.png) where
 where  represents a
 represents a  , respectively
, respectively  duty cycle. The expected voltage output is defined in the following table:
 duty cycle. The expected voltage output is defined in the following table:
| Duty Cycle | Output voltage (Arduino) | Output voltage (ESP8266 and ESP32) | analogWrite | 
|---|---|---|---|
|   |   |   |   | 
|   |   |   |   | 
|   |   |   |   | 
|   |   |   |   | 
|   |   |   |   |