esp32_devkit
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédenteDernière révisionLes deux révisions suivantes | ||
esp32_devkit [2019/02/09 14:06] – [Troubleshooting] bigMax | esp32_devkit [2020/07/25 09:14] – bigMax | ||
---|---|---|---|
Ligne 3: | Ligne 3: | ||
Ce kit a été créé par une boite nommée Espressif. [[ https:// | Ce kit a été créé par une boite nommée Espressif. [[ https:// | ||
- | {{ :max: | + | {{ media_06: |
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
Ligne 81: | Ligne 81: | ||
* SPI2 (HSPI) | * SPI2 (HSPI) | ||
* SPI3 (VSPI) | * SPI3 (VSPI) | ||
+ | |||
+ | Sketch examples pour manipuler les 2 ports SPI hardware : [[ https:// | ||
=== HSPI (SPI2) === | === HSPI (SPI2) === | ||
Ligne 93: | Ligne 95: | ||
* MOSI => GPIO 19 | * MOSI => GPIO 19 | ||
* SS => GPIO 5 | * SS => GPIO 5 | ||
+ | |||
==== Notes ==== | ==== Notes ==== | ||
Ligne 101: | Ligne 104: | ||
* Lors de l' | * Lors de l' | ||
* Lors de l' | * Lors de l' | ||
+ | * Ajouter l' | ||
==== Pilotage d'un écran TFT 240x240 px : le ST7789 ==== | ==== Pilotage d'un écran TFT 240x240 px : le ST7789 ==== | ||
- | {{ :max: | + | {{ media_06: |
Cablage | Cablage | ||
Ligne 115: | Ligne 119: | ||
* 7 BLK Backlight control, the default can be left floating, low level to turn off the backlight. | * 7 BLK Backlight control, the default can be left floating, low level to turn off the backlight. | ||
- | Téléchargement de la bibliothèque | + | Je recommande |
+ | \\ | ||
+ | Je déconseil la lib d' | ||
+ | \\ | ||
+ | Configuration de la lib TFT-eSPI dans le fichier User_Setup.h : | ||
+ | <code c> | ||
+ | #define ST7789_DRIVER | ||
- | La bibliothèque arduino GFX est également nécéssaire. Elle est disponible dans le " | + | #define TFT_WIDTH |
+ | #define TFT_HEIGHT 240 | ||
- | Configuration du sketch : | + | #define TFT_MISO 23 |
+ | #define TFT_MOSI 19 | ||
+ | #define TFT_SCLK 18 | ||
+ | #define TFT_CS | ||
+ | #define TFT_DC | ||
+ | #define TFT_RST | ||
+ | </ | ||
- | <code c> | + | Plus de code sur github ici : https://github.com/ |
- | #define TFT_CS | + | |
- | #define TFT_RST | + | |
- | #define TFT_DC | + | |
- | #define TFT_SCLK | + | |
- | #define TFT_MOSI | + | |
- | Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST); | + | ===== Les premiers pas de Bjorn sur l' |
+ | Mon objectif initial est de tester des librairies graphiques en vue d'un futur projet sur ce genre de hardware | ||
+ | Le module ESP32 m'a été gentiment prêté par Gaziel qui en avait un au fond de son sac. Celui-ci viens du marché chinois des internets et laisse une rangé de libre de chaque coté de la breadboard une fois enfiché. | ||
+ | |||
+ | ==== Hardware ==== | ||
+ | === L' | ||
+ | l' | ||
+ | === Le montage === | ||
+ | Le montage respecte le schéma présenté sur le site [[http:// | ||
+ | |||
+ | {{https:// | ||
+ | |||
+ | ^ LCD SCREEN ^ NODEMCU ESP32 ^ | ||
+ | |5V| 3v3| | ||
+ | |GND| GND| | ||
+ | |LED| 5V| | ||
+ | |SCL (SPI Clock)| GPIO18 VSPI SCK (SPI Clock)| | ||
+ | |SDA (SPI Data)| GPIO23 VSPI MOSI (MOSI, Data to Screen)| | ||
+ | |RS (Register Select)| GPIO2 (labelled as DC in Adafruit code)| | ||
+ | |RST (Screen reset) | GPIO4| | ||
+ | |CS (Chip Select : Defined as Slave Select in SPI) If low this device is active on data lines| GPIO5 VSPI SS (Slave Select/ Chip Select)| | ||
+ | |||
+ | ==== Software ==== | ||
+ | === Les librairies === | ||
+ | {{ media_02: | ||
+ | * Une des premières documentation que j'ai eu étant le site de [[http:// | ||
+ | * J'ai ensuite répéré la librairie [[https:// | ||
+ | * J'ai enfin arrêté de faire pas comme les autres et me suis rabatu sur la lib d' | ||
+ | <code c> | ||
+ | #define TFT_CS | ||
+ | #define TFT_RST | ||
+ | #define TFT_DC | ||
</ | </ | ||
+ | * Le truc un peu foufou avec cette lib c'est qu' | ||
- | Plus de code sur github ici : [[ https://github.com/mxbossard/laperco-capteurs/tree/master/arduino_sketches/lora_uart_tester_screen ]] | + | <code c> |
+ | Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, | ||
+ | |||
+ | tft.initR(INITR_BLACKTAB); | ||
+ | tft.initR(INITR_GREENTAB); | ||
+ | | ||
+ | tft.initR(INITR_144GREENTAB); | ||
+ | //if using a 0.96" 180x60 TFT: | ||
+ | tft.initR(INITR_MINI160x80); | ||
+ | // etc. | ||
+ | </ | ||
+ | ==== Notes ==== | ||
+ | * todo | ||
===== Notes pour l' | ===== Notes pour l' | ||
Ligne 138: | Ligne 194: | ||
cf : [[https:// | cf : [[https:// | ||
- | {{tag> | + | {{tag> |
esp32_devkit.txt · Dernière modification : 2020/10/27 18:33 de serge