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 where represents a , respectively duty cycle. The expected voltage output is defined in the following table:
Duty Cycle | Output voltage (Arduino) | Output voltage (ESP8266 and ESP32) | analogWrite |
---|---|---|---|