The puls should be much longer, right? If I want a 100% Pulse width (255) then it should look like a constant line. My TON is around 200us and TOFF is 800us long .. (At a 100% Pulse)
HI,
Despite having a port for reading analog variables, the ESP8266 NodeMCU module does not have pins that can be used to supply voltage signals whose modules are part of the intermediate values of the range that goes from 0V to 3.3V. However, it is possible to use digital output ports to simulate analog output ports through the use of PWM, which in turn is a technique through which we can obtain analog results by digital means.
This feature consists of generating a square wave, in which the percentage of time the wave remains at a high logic level is controlled. This percentage is called the Duty Cycle and its alteration causes a change in the average value of the wave, ranging from 0V (0% of Duty Cycle) to 3.3V (100% of Duty Cycle) in the case of the ESP8266 NodeMCU. The Duty Cycle to be defined in the project corresponds to an integer number, which is stored in a 10-bit register. Therefore, its value ranges from 0 (0%) to 1023 (100%).