数字引脚对应编程见附件VI,截图如下——
有必要说明下PWM输出是软件实现的,非硬核PWM输出,D0~D16均可实现,内核文档说明如下:
Analog output¶analogWrite(pin, value) enables software PWM on the given pin. PWMmay be used on pins 0 to 16. Call analogWrite(pin, 0) to disable PWMon the pin. value may be in range from 0 to PWMRANGE, which isequal to 1023 by default. PWM range may be changed by callinganalogWriteRange(new_range). PWM frequency is 1kHz by default. CallanalogWriteFreq(new_frequency) to change the frequency. Valid valuesare from 100Hz up to 40000Hz. The ESP doesn’t have hardware PWM, so the implementation is by software.With one PWM output at 40KHz, the CPU is already rather loaded. The morePWM outputs used, and the higher their frequency, the closer you get tothe CPU limits, and the less CPU cycles are available for sketch execution.
|