=================================
Pour utiliser sous Ubuntu 22 :
sudo apt remove brltty
Et redémarrer le PC
Puis choisir NodeMCU 1.0 (ESP-12E) comme carte
================================
Usage identique à l’ESP-12 facilité car pour charger le sketch, simplement appuyer sur Reset puis sur flash. Retirez la partie « Esp » et vous pourrez l’alimenter via la prise USB en 5v. Utilisez le bouton Reset pour relancer le sketch.
Pour compiler le sketch choisissez Type de carte : NodeMCU 1.0 (ESP-12E Module) ou Adafruit Feather HUZZAH ESP8266. Pour ajouter les cartes ESP8266 :
- Open Preferences window and enter the following into the ‘Additional Board Manager URLs’ field: “http://arduino.esp8266.com/stable/package_esp8266com_index.json“.
- Under Boards Manager, install ESP8266 by ESP8266 Community.
- Under Tools/Boards select “Adafruit Feather HUZZAH ESP8266“.
- Set Upload Speed to “115200“.
- Select the port that the board is attached to. In my case it happened to be COM3
- In the Serial Monitor window, set comm rate to 115200 and line ending to Both NL & CR
Toutes les broches peuvent utiliser le protocole PWM ( Pulse Width Modulation, signal pseudo analogique) et les interruptions (sauf la broche 16). Toutes les broches sont de type résistances pull-up et pull-down.
Il y a 11 digital I/O pins, 2 TX/RX
La plage PWM par défaut est de 0 à 1023alors que sur l’Arduino de 0 à 255 Cela peut être modifié en utilisant analogWriteRange (255)
La fréquence PWM est de 1kHz par défaut. Utilisez analogWriteFreq(500) pour la diminuer.
The pins are labeled GPIOx. When using with Arduino IDE, the digital pin number is the samethe pin number, so GPIO2 is referenced as just ‘2’.
The small blue on-board LED is connected to pin 2 (GPIO2).
The on-board general purpose pushbutton on the top board is connected to pin 4 (GPIO4).
The RGB LED is common cathode and so lights when driven HIGH. It is connected to the following pins:
- Pin 15 (GPIO15) = RGB Red LED
- Pin 12 (GPIO12) = RGB Green LED
- Pin13 (GPIO13) = RGB Blue LED
Per spec, the digital I/O is limited to 3.3V, but the mfr has made statements that the digital pins are in fact 5V tolerant and there are many installations using the module directly connected to the logic lines of 5V MCUs, so use your own judgment.
Analog I/O
The analog input A0 (ADC) is a single 10-bit ADC input which is connected to the LDR (Light Dependent Resistor).
The LDR has a dark resistance of about 2.5K and is in series with a 470 ohm resistor to form a voltage divider that feeds the ADC input. The LDR is connected to the Vcc side of the voltage divider and the 470 ohm resistor connects to ground. As the light intensity increases, the LDR resistance decreases and therefore the voltage on the ADC input increases.
By measuring the voltage, the relative brightness of the light falling on the sensor can be determined.
Powering the Module
The module can be powered via the USB port on either the top or bottom board or by using an external 5V power supply connected to the Vcc pin.
Exemples :
LED et bouton et LDR : https://gist.github.com/cyrgui/e4f13f2031261517c90183df05cfa4ad
Contact HTTPS : https://gist.github.com/cyrgui/dc4888045c95fda761495950ce6af3a4
Détection fin d’impression avec capteur IR et envoi de SMS : https://gist.github.com/cyrgui/d62ca9e2db8d052516b47d4cceb601ad
Références :