PC Fans: Difference between revisions

Line 93: Line 93:
}
}
</syntaxhighlight>
</syntaxhighlight>
The ESP8266 requires a call to <tt>analogWriteFreq(25000);</tt> before using <tt>analogWrite()</tt> to set an 8-bit duty cycle. This is a global setting, and will affect any other <tt>analogWrite()</tt>s in your program. If you don't like it, you can always bitbang.
The [[ESP8266]] requires a call to <tt>analogWriteFreq(25000);</tt> before using <tt>analogWrite()</tt> to set an 8-bit duty cycle. This is a global setting, and will affect any other <tt>analogWrite()</tt>s in your program. If you don't like it, you can always bitbang.


Note that 25KHz is beyond the capability of many general-purpose PWM ICs (e.g. TLC5940, PCA9685).
Note that 25KHz is beyond the capability of many general-purpose PWM ICs (e.g. TLC5940, PCA9685).