ESP8266: Difference between revisions

Tags: Mobile edit Mobile web edit
Tags: Mobile edit Mobile web edit
Line 14: Line 14:
* Four PWM channels on pins 10, 13, 9, and 16
* Four PWM channels on pins 10, 13, 9, and 16
===ADC===
===ADC===
* There is only one (10-bit) ADC, and it reports values between [0, 1], ''not'' [0, 3.3]. This is not a scaling--the input voltage should not exceed 1V.
There is only one (10-bit) ADC, and it reports values between [0, 1], ''not'' [0, 3.3]. This is not a scaling--the input voltage should not exceed 1V. The NodeMCU changes this significantly:
** This is not true for e.g. the NodeMCU, which [https://www.electronicwings.com/nodemcu/nodemcu-adc-with-arduino-ide applies a divider network] to scale the 3.3V down to 1V. This allows supplying 3.3V to the external device.
* The NodeMCU [https://www.electronicwings.com/nodemcu/nodemcu-adc-with-arduino-ide applies a divider network] to scale the 3.3V down to 1V. This usefully allows supplying 3.3V to the external device.
** On the NodeMCU, this ADC can read the battery voltage instead of a connected external device. This is set in firmware.
* On the NodeMCU, this ADC can read the battery voltage instead of a connected external device. This is set in firmware.
* If the ADC is left unconnected, V<sub>CC</sub> can be read using <tt>ESP.getVcc()</tt>. Before calling this function, <tt>ADC_MODE(ADC_TOUT)</tt> (for external voltage) or <tt>ADC_MODE(ADC_VCC)</tt> (for system voltage) must be called.


==External links==
==External links==