Posts

Showing posts with the label arduino-esp32

ESP32S3 (Arduino framework) decode jpg and display on ST7789 SPI Display.

Image
Base on former exercise of " 240x240 ST7789V2 SPI IPS with FT6236 cap touch on XIAO ESP32S3 using GFX Library for Arduino ", this exercise run on XIAO ESP32S3 Sense in Arduino framework, load jpg from SD, decode the jpg using JPEGDEC library, and display on  1.54 inch 240x240 ST7789V2 SPI IPS with FT6236 cap touch using GFX Library for Arduino (Arduino_GFX_Library). Connection follow the former exercise . Install the following libraries in Arduino IDE's Library Manager. - GFX Library for Arduino (Arduino_GFX_Library) for display on ST7789 - JPEGDEC for jpg decoding Exercise code: XiaoS3_ST7789_SD_jpg_scale.ino /******************************************************************************* Xiao ESP32S3 Sense exercise Display jpg on 240x240 ST7789 SPI IPS - Display jpg in various scale. Libraries needed (available in Arduino IDE Library Manager): - GFX Library for Arduino (Arduino_GFX_Library) for display on ST7789 - JPEGDEC for jp...

Xiao ESP32S3 Sense read MicroSD

Image
Exercise run on  Xiao ESP32S3 Sense in Arduino framework, read SD Card. Base on the exercise " 240x240 ST7789V2 SPI IPS with FT6236 cap touch on XIAO ESP32S3 using GFX Library for Arduino ", display ST7789 LCD. XiaoS3_ST7789_SD.ino , read and display SD info and hello.txt content. /******************************************************************************* Xiao ESP32S3 Sense exercise ******************************************************************************/ /******************************************************************************* * Start of Arduino_GFX setting ******************************************************************************/ #include <Arduino_GFX_Library.h> //=== Custom to match my connection =========================================== #define PIN_BLK 4 #define PIN_CS 3 #define PIN_DC 2 #define PIN_RES 1 #define PIN_SDA 9 #define PIN_SCL 7 #define GFX_BL PIN_BLK #define CTP_INT 43 #define CTP_RST 44 #define FT6236_AD...

Arduino_GFX_Library + LVGL on ESP32S3 + ST7789 SPI IPS with FT6236 cap touch, create button to toggle onboard LED

Image
Last exercise on Xiao ESP32S3 Sense, to display on 240x240 ST7789V2 SPI IPS using Arduino_GFX_Library, and interface FT6236 cap touch using Wire I2C, in Arduino framework . This exercise add function of LVGL. Connection , following in last exercise . Preparation: - Install GFX Library for Arduino in Arduino IDE Library Manager,   follow last exercise , make sure both ST7789 and FT6236 works. - Install LVGL library in Arduino IDE Library Manager.   Using LVGL with Arduino requires some extra steps:   *Be sure to read the docs here: https://docs.lvgl.io/master/get-started/platforms/arduino.html   Copy lv_conf_template.h in lvgl library directory, rename as lv_conf.h and save into the Arduino Libraries directory. To enable the content of the file, change the first #if 0 to #if 1. #if 1 //0 /*Set it to "1" to enable content*/ Exercise code: XIAOS3_ST7789_FT6236_LVGL_Arduino_v9.ino , my exercise to create a button to toggle the ...

240x240 ST7789V2 SPI IPS with FT6236 cap touch on XIAO ESP32S3 using GFX Library for Arduino

Image
My exercise on  Seeed Studio XIAO ESP32S3 Sense (Arduino framework) to display on  1.54 inch 240x240 ST7789V2 SPI IPS with FT6236 cap touch . ST7789 Display part using GFX Library for Arduino FT6236 Cap touch part read via I2C (Wire) Connection: ST7789V2 -------- GND GND VCC 3V3 SCL GPIO7 SDA GPIO9 RES GPIO1 DC GPIO2 CS GPIO3 BLK GPIO4 FT6236 ------ SCL GPIO6 SDA GPIO5 INT GPIO43 (Not used) RST GPIO44 Exercise Code: XS3_ST7789_GFX_color_touch.ino /* XIAO ESP32S3 display on 240x240 ST7789 SPI IPS with FT6236 cap touch using GFX Library for Arduino - Color and Touch Test Arduino_GFX https://github.com/moononournation/Arduino_GFX Connection: ST7789V2 -------- GND GND VCC 3V3 SCL GPIO7 SDA GPIO9 RES GPIO1 DC GPIO2 CS GPIO3 BLK GPIO4 FT6236 ------ SCL GPIO6 SDA GPIO5 INT Not use RST GPIO44 */ #include <Arduino_GFX_Library.h> #include <Wire.h> /...

UART (Serial1) communication between XIAO ESP32C3 and Raspberry Pi Pico (RP2040), in Arduino framework.

Image
This exercise show UART (Serial1) communication between XIAO ESP32C3 and Raspberry Pi Pico (RP2040) , in Arduino framework. Connection:      Pico TX GP0 (pin 1) <-----> XIAO ESP32C3 RX GPIO20 (pin 8)      Pico RX GP1 (pin 2) <-----> XIAO ESP32C3 TX GPIO21 (pin 7)      Pico GND                        <-----> XIAO ESP32C3 GND Code: The main issue for this exercise is how to handle Serial1.begin() for XIAO ESP32C3. Ref: https://wiki.seeedstudio.com/XIAO_ESP32C3_Pin_Multiplexing/#serial---uart There is no Serial2 for XIAO ESP32 C3. Also If you need to use Serial1, you must define the pins; otherwise, it may not receive data. For XIAO ESP32 series, use Serial1 as follows:      Serial1.begin(115200, SERIAL_8N1, RX, TX); rp_SerialPassthrough_115200_8N1.ino /* UART/Serial1 exercise run on Raspberry Pi Pi...

Seeed Studio XIAO ESP32S3 Sense display on 2.4" TFT 240×320 ST7789V using Adafruit_ST7789 lib in Arduino framework.

Image
Exercise running on  Seeed Studio XIAO ESP32S3 Sense , to display on 2.4" TFT 240×320 ST7789V using Adafruit_ST7789 lib in Arduino framework. Board and library installed: esp32 by Espressif System (arduino-esp32) 3.0.3 Adafruit ST7735 and ST7789 Library 1.10.4 Connection: Code: XiaoS3_ST7789_SPI_240x320_color.ino /************************************************************************** XIAO ESP32S3 Connect display on 2.4" IPS 240x320 SPI (ST7789V) : Color Test Connection: ST7789 XIAO ESP32S3 1 GND GND 2 VCC 3V3 3 SCL GPIO7 (hardware SPI SCK) 4 SDA GPIO9 (hardware SPI MOSI) 5 RST GPIO2 6 DC GPIO3 7 CS GPIO4 8 BL 3V3 **************************************************************************/ #include <Adafruit_GFX.h> // Core graphics library #include <Adafruit_ST7789.h> // Hardware-specific library for ST7789 #include <SPI.h> #define TFT_RST ...

First try CameraWebServer on Seeed Studio XIAO ESP32S3 Sense + ov5640 Camera (Auto-Focusing), in Arduino framework.

Image
First try CameraWebServer on Seeed Studio XIAO ESP32S3 Sense + ov5640 Camera (Auto-Focusing) , in Arduino framework. Make sure  ESP32 (Arduino-ESP32) is installed to your Arduino IDE , 3.0.2 is installed in this video. Select board of esp32 > XIAO ESP32S3 Open Examples for XIAO_ESP32S3 > ESP32 > Camera > CameraWebServer un-comment the line: #define CAMERA_MODEL_XIAO_ESP32S3 and comment all other CAMERA_MODEL. Edit ssid and password to match with your WiFi network. optionally, you can compare with Seeed Studio XIAO ESP32S3 Sense Schematic . To check the supported camera sensor: Right click on any _PID (OV3660_PID here) in the code, click on Go to Definition. You can add code to check the attached camera sensor at runtime. CameraWebServer.ino #include "esp_camera.h" #include <WiFi.h> // // WARNING!!! PSRAM IC required for UXGA resolution and high JPEG quality // Ensure ESP32 Wrover Module or other board ...

Fix Waveshare ESP32-S3-Zero/Nologo ESP32C3SuperMini Serial.print() not work - enable USB CDC on Boot

Image
Waveshare ESP32-S3-Zero   does not have a USB to UART chip mounted, you need to use the USB of the ESP32-S3 as the download interface and the Log print interface, and you need to enable the USB CDC when using the Arduino IDE . ~ ref:  https://www.waveshare.com/wiki/ESP32-S3-Zero This apply to  Nologo ESP32C3SuperMini also .

ESP32-S3-Zero display on 0.85 inch 128x128 LCD with GC9107 SPI driver, using Arduino_GFX.

Image
This post show steps to using Waveshare ESP32-S3-Zero to display on Waveshare 0.85 inch 128x128 LCD with GC9107 SPI driver , using GFX Library for Arduino (Arduino_GFX)​. Make sure GFX Library for Arduino (Arduino_GFX) is installed in Library Manager. Connection: GC9107 ESP32-S3-Zero --------------------- VCC 3V3 GND GND DIN GP11 CLK GP12 CS GP10 DC GP9 RST GP8 BL GP7 Code for Arduino_GFX setting: //========== Arduino_GFX setting =============================================== #define TFT_DIN 11 #define TFT_CLK 12 #define TFT_CS 10 #define TFT_DC 9 #define TFT_RST 8 #define TFT_BL 7 #define GFX_BL TFT_BL // https://github.com/moononournation/Arduino_GFX/wiki/Data-Bus-Class#spi-1 Arduino_DataBus *bus = new Arduino_ESP32SPI(TFT_DC, TFT_CS, TFT_CLK, TFT_DIN, GFX_NOT_DEFINED /* MISO */, HSPI /* spi_num */); //https://github.com/moononournation/Arduino_GFX/wiki/Display-Class#gc9107-ips-lcd-128x128 Arduino_GFX *gfx = new Ardu...

BLE communication between MicroPython aioble and ArduinoBLE

Image
Previous posts introduced " MicroPython bluetooth remote control LED between Raspberry Pi Pico W and ESP32-C3, using aioble library " and " BLE examples run on Nano 33 BLE (as Peripheral) and Uno R4 WiFi (as Central) using ArduinoBLE in Arduino Framework ". This video further test how BLE communication between that two approach.

128x160 TFT/ST7735 SPI wih EP32C3 (arduino-esp32) using Arduino_GFX Library

Image
Previous post show 3.5 inch 480x320 TFT/ILI9488 SPI wih EP32C3 (arduino-esp32) using Arduino_GFX Library , here is how it display on 1.8 inch 128x160 ST7735 SPI TFT . Both the 3.5 inch 480x320 ILI9488 SPI TFT and 1.8 inch 128x160 ST7735 SPI TFT have the same pins assignment on TFT part, keep the connection keep no change. Code: c3_st7735_test.ino , for color and resolution test. /******************************************************************************* * Exercise of Arduino_GFX, color testing. * Run on Xiao ESP32C3 + 1.8 inch 128x160 ST7735 SPI TFT ******************************************************************************/ #include <Arduino_GFX_Library.h> #define TFT_CS 5 //GPIO5 #define TFT_RESET 3 //GPIO3 #define TFT_DC 4 //GPIO4 #define TFT_MOSI 10 //GPIO10/MOSI #define TFT_SCK 8 //GPIO8/SCK #define TFT_LED 2 //GPIO2 #define TFT_MISO -1 // not used for TFT #define GFX_BL TFT_LED // backlight pin /* More data bus cl...

480x320 TFT/ILI9488 SPI wih EP32C3 (arduino-esp32) using Arduino_GFX Library

Image
Display on 3.5 inch 480x320 TFT with SPI ILI9488 (SKU:MSP3520) with XIAO EP32C3 (arduino-esp32) using Arduino_GFX Library. Install GFX Library for Arduino (Arduino_GFX) in Library Manager. Arduino_GFX is a Arduino graphics library supporting various displays with various data bus interfaces. This library start rewrite from Adafruit_GFX, LovyanGFX, TFT_eSPI, Ucglib, and more... Connection:      Connection between XIAO ESP32C3 and      3.5" 480x320 TFT with SPI ILI9488 (SKU:MSP3520)      XIAO ESP32C3                        +-------------+           +---------|GPIO2    5V      |          | +-----|GPIO3    GND    |-----------+ | +-|-----|GPIO4    3V3    |---------+ | | | | +---|GPIO5    GPIO10|-----...

CameraWebServe: ESP32-S3 (arduino-esp32) + OV5640 camera module

Image
ESP32 CameraWebServer (arduino-esp32 framework) run on NodeMCU ESP-S3-12K-Kit + Waveshare OV5640 Camera Board (B) 5 Megapixel (2592x1944) . Connection, define in camera_pins.h. Modified camera_pins.h //=== my pin asssignment ===== #define PWDN_GPIO_NUM 35 #define RESET_GPIO_NUM 8 #define XCLK_GPIO_NUM 40 #define SIOD_GPIO_NUM 42 #define SIOC_GPIO_NUM 1 #define Y9_GPIO_NUM 4 #define Y8_GPIO_NUM 16 #define Y7_GPIO_NUM 11 #define Y6_GPIO_NUM 15 #define Y5_GPIO_NUM 13 #define Y4_GPIO_NUM 37 #define Y3_GPIO_NUM 14 #define Y2_GPIO_NUM 36 #define VSYNC_GPIO_NUM 9 #define HREF_GPIO_NUM 41 #define PCLK_GPIO_NUM 3 //============================ Modified CameraWebServer.ino #include "esp_camera.h" #include <WiFi.h> // // WARNING!!! PSRAM IC required for UXGA resolution and high JPEG quality // Ensure ESP32 Wrover Module or other board with PSRAM ...

Read TMP102 with XIAO ESP32-C3 (Arduino Framework)

Image
Read TMP102 with XIAO ESP32C3 (in Arduino Framework) using Temperature_LM75_Derived . Connection: TMP102 XIAO ESP32-C3 --------------------- VCC 3V3 GND GND SDA SDA/D4 SCL SCL/D5 Install I2C Temperature Sensors derived from the LM75. This library supports a large range of I²C temperature sensors based on the industry-standard LM75 package. Click on File > Examples > I2C Temperature Sensors derived from the LM75 > BasicUsage To run on ESP32C3, comment the line: while(!Serial) {} /* Read the temperature from an LM75-derived temperature sensor, and display it in Celcius every 250ms. Any LM75-derived temperature should work. */ #include <Temperature_LM75_Derived.h> // The Generic_LM75 class will provide 9-bit (±0.5°C) temperature for any // LM75-derived sensor. More specific classes may provide better resolution. Generic_LM75 temperature; void setup() { //while(!Serial) {} Serial.begin(9600); Wire.begin(); } void loop() { Serial...

Install ESP32 (Arduino-ESP32) to Arduino IDE 2, on Windows 11.

Image
To install ESP32 (Arduino-ESP32) to Arduino IDE 2: - Click on File in Arduino IDE Menu Bar > Preferences... - Scroll down to Additional Board Manager URLs field. Enter the link in Additional Board Manager URLs field: - Stable release link: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json - Development release link: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json Then, install esp32 by Espressif System in Boards Manager.

Display on 1.28" 240x240 Round IPS LCD (with GC9A01 SPI driver) with ESP32 (arduino-esp32) using GFX Library for Arduino (Arduino_GFX)

Image
Display on 1.28" 240x240 Round IPS LCD (with GC9A01 SPI driver) with ESP32-DevKitC V4 (arduino-esp32) using GFX Library for Arduino (Arduino_GFX) Install GFX Library for Arduino (Arduino_GFX) in Arduino IDE's Library Manager. Arduino_GFX is a Arduino graphics library supporting various displays with various data bus interfaces. Open File > Examples > GFXLibrary for Arduino > HelloWorld Comment the original Arduino_GFX setting, and replace with my custom setting for GC9A01, matching with my connection.  Modified HelloWorld.ino is listed here for reference. /******************************************************************************* * Start of Arduino_GFX setting * * Arduino_GFX try to find the settings depends on selected board in Arduino IDE * Or you can define the display dev kit not in the board list * Defalult pin list for non display dev kit: * Arduino Nano, Micro and more: CS: 9, DC: 8, RST: 7, BL: 6, SCK: 13, M...

Min. exercises to display on 2.13" 250x122 3-color E-paper with ESP32-S3, using GxEPD2 and Adafruit_EPD

Image
In my former posts, show how to install library and run example to display on 2.13" 250x122 3-color Epaper with ESP32-S3, using GxEPD2 and Adafruit_EPD . Here is my minimum exercise using GxEPD2 and Adafruit_EPD libraries respectively. ESP32_GxEPD2_SSD1680.ino , using ZinggJM/GxEPD2 library. /* *Minimum exercise using ZinggJM/GxEPD2 *Run on ESP32 Dev Module *display on 2.13" 250x122 3-color E-paper (SSD1680) * * ref: GxEPD2_MinimumExample.ino * https://github.com/ZinggJM/GxEPD2/blob/master/examples/GxEPD2_MinimumExample/GxEPD2_MinimumExample.ino * */ #include <GxEPD2_3C.h> // including both doesn't use more code or ram #include <Fonts/FreeMonoBold9pt7b.h> #define EPD_CS 5 #define EPD_DC 0 #define SRAM_CS -1 #define EPD_RESET 2 #define EPD_BUSY 15 GxEPD2_3C<GxEPD2_213_Z98c, GxEPD2_213_Z98c::HEIGHT> display( GxEPD2_213_Z98c(EPD_CS, EPD_DC, EPD_RESET, EPD_BUSY)); void setup() { display.init(); display.setRotatio...