Bug? NodeMcu ESP8266 AnalogWrite values

derez

Expert
Licensed User
Longtime User
Testing the NodeMcu I have found that the max value in AnalogWrite is 1023 (= digitalwrite(true)), not 255.
 

janderkan

Well-Known Member
Licensed User
Longtime User
On ESP the default PWM range is 0 to 1023.
And default PWM frequency is 1KHz.
http://esp8266.github.io/Arduino/versions/2.0.0/doc/reference.html

These values can be changed.
Attached is the files.

Copy rESP8266.xml to folder: C:\Program Files (x86)\Anywhere Software\B4R\Libraries
Copy rESP8266.h and rESP8266.cpp to: C:\Program Files (x86)\Anywhere Software\B4R\Libraries\rESP8266
Remember to create a backup copy first !

I hope the right person will include this in the next version of B4R :)
 

Attachments

  • rESP8266.zip
    1.3 KB · Views: 305
Top