Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By martinayotte
#40195 Do you means to read back the analog value of your analog output generated using PWM ?
Yes, you can, but you need first to filter out the PWM to make it a real steady analog output using resistor and capacitor, and secondo, you need to scale down the range so it can fit within the 0-1V range of the ADC.
User avatar
By gorec2005
#40291
martinayotte wrote:Do you means to read back the analog value of your analog output generated using PWM ?
Yes, you can, but you need first to filter out the PWM to make it a real steady analog output using resistor and capacitor, and secondo, you need to scale down the range so it can fit within the 0-1V range of the ADC.

I mean read back not analog value, but current digital PWM value from inside cpu (direct read from system register, or other similar ways)
User avatar
By martinayotte
#40294 Oh ! I see ...
If you wish to read back the values you've assigned in analogWrite(pin, value), they are stored into "uint16_t pwm_values[17]" locally in core_esp8266_wiring_pwm.c.
Unfortunately, there are no function yet to read them back, but you can easily write one in this file for your own purposes.