ESP12 : Utilisation GPIO

LED Pin :

GPIO1 which is also TX is wired to the blue LED on many devices. Note that the LED is active low (conected to Vcc and sinks through the chip to ground) so setting a logical value of 0 will light it up. Since GPIO1 is also the TX pin, you won’t be able to blink the LED and perform Serial communications at thew same time unless you switch TX/RX pins.

Maximum Current :

When using a GPIO as output (i.e. to drive something such as an LED) it is important to note that the maximum output current is 12mA. (IMAX=12mA per Espressif datasheet) If you try and output more current than that, you run the risk of damaging the device. Since many LEDs are able to draw 20mA you should adjust your current limiting resistor to be 12mA or less. Using https://en.wikipedia.org/wiki/LED_circuit – R=(Vout-Vled)/I so (3.3V-1.8Vred) at 12mA = 125Ω min for a red LED.

PWM :

analogWrite(pin, value) enables software PWM on the given pin. PWM may be used on pins 0 to 15. Call analogWrite(pin, 0) to disable PWM on the pin. value may be in range from 0 to 1023. 0 to 255 is normal on an arduino board as its an 8bit ADC but ESP8266 is 10 bit so 1023 is full duty cycle.

Références :

http://www.esp8266.com/wiki/doku.php?id=esp8266_gpio_pin_allocations#led_pin

 

Articles récents
Commentaires récents
fatima sur Bienvenue !
AdminDroid sur Bienvenue !
fatima sur Bienvenue !
Archives
Catégories
%d blogueurs aiment cette page :