Posts

Showing posts with the label Arduino

Waveshare ESP32-S3-Touch-LCD-4B Hello World

Image
Basic Test run on  Waveshare ESP32-S3-Touch-LCD-4B , with built-in 4inch 480 × 480 resolution ST7701 RGB interface LCD. S3_ST7701_basictest.ino /* Basic test run on Waveshare ESP32-S3-Touch-LCD-4B https://coxxect.blogspot.com/2026/06/waveshare-esp32-s3-touch-lcd-4b-hello.html Remark about "USB CDC On Boot" option for Serial.print() If host PC connect to USB TO UART port (lower one), select USB CDC On Boot: "Disabled". If connect to ESP32-S3 USB Interface port (middle one), select USB CDC On Boot: "Enabled" Otherwise, you cannot see the output by Serial.print(). */ #include <Arduino.h> #include "Arduino_GFX_Library.h" #define BL 4 Arduino_XCA9554SWSPI *expander = new Arduino_XCA9554SWSPI( 7, 0, 2, 1, &Wire, 0x20); Arduino_ESP32RGBPanel *rgbpanel = new Arduino_ESP32RGBPanel( 17 /* DE */, 3 /* VSYNC */, 46 /* HSYNC */, 9 /* PCLK */, 10 /* B0 */, 11 /* B1 */, 12 /* B2 */, 13 /* B3 */, 14 /* B4 */, 21 ...

Prepare HelloWorld for Waveshare ESP32-S3-Touch-AMOLED-2.16, in Arduino framework.

Image
Prepare libraries to run HelloWorld on Waveshare ESP32-S3-Touch-AMOLED-2.16 , in Arduino framework. Following the steps in Waveshare docs, ESP32-S3-Touch-AMOLED-2.16 > Working with Arduino Notice: About display resolution: currently, both LCD_WIDTH and LCD_HEIGHT in libraries//Mylibrary/pin_config.h are set 466, have to set it 480 to match the actual resolution. The following exercise define LCD connection in code, so no need to #include "pin_config.h". S3_CO5300_basictest.ino /* Exercise run on ESP32-S3-Touch-AMOLED-2.16 https://coxxect.blogspot.com/2026/05/prepare-helloworld-for-waveshare-esp32.html Remark about "USB CDC On Boot" option for Serial.print() For Waveshare ESP32-S3-Touch-AMOLED-2.16 with a single USB port only, select USB CDC On Boot: "Enabled". Otherwise, you cannot see the output by Serial.print(). */ #include <Arduino.h> #include "Arduino_GFX_Library.h" // === #define LCD_SDIO0 4...

Install Arduino IDE 2.3.8 and ESP32 Arduino Core on Linux Mint 22.3 (Over VirtualBox 7.2.8)

Image
To install the Arduino IDE 2.3.8 on Linux Mint using the AppImage format, tested on Linux Mint 22.3 Xfce over VirtualBox on Windows 11. Step 1: Download the AppImage - Go to the official Arduino Software page . - Look for Arduino IDE 2.3.8 (or the latest version). - Click on the "Linux AppImage 64 bits" link to download the file. - You can move the downloaded file to other folder you want. Step 2: Grant Execution Permission By default, Linux treats downloaded AppImages as non-executable files for security. You must enable execution rights. Option A: Using the Terminal (Recommended) Open your terminal and navigate to the folder contain the downloaded file: chmod +x arduino-ide_2.3.8_Linux_64bit.AppImage Option B: Using the GUI - Right-click the downloaded .AppImage file. - Select Properties. - Go to the Permissions tab. - Check the box that says "Allow executing file as program". Step 3: Configure Serial Port Permissions (dialout) In Linux, your user accou...

Waveshare ESP32-C5-WIFI6-KIT-N16R8 to control onboard RGB LED using Adafruit_NeoPixel library, Arduino framework.

Image
Exercise run on Waveshare ESP32-C5-WIFI6-KIT-N16R8 to control onboard RGB LED using Adafruit_NeoPixel library. ESP32C5_RGB.ino /* Exercise run on Waveshare ESP32-C5-WIFI6-KIT-N16R8 to control onboard RGB LED using Adafruit_NeoPixel library. The onboard RGB on Waveshare ESP32-C5-WIFI6-KIT-N16R8 is connected to GPIO27. https://coxxect.blogspot.com/2026/02/waveshare-esp32-c5-wifi6-kit-n16r8-to.html */ #include <Adafruit_NeoPixel.h> // Pin where the onboard RGB is connected #define LED_PIN 27 // Number of LEDs (number of onboard RGB is 1) #define LED_COUNT 1 // Create NeoPixel object Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_RGB + NEO_KHZ800); void setup() { strip.begin(); // Initialize NeoPixel library strip.show(); // Turn OFF all pixels ASAP strip.setBrightness(50); // Adjust brightness (0–255) } void loop() { // Cycle through Red, Green, Blue strip.setPixelColor(0, strip.Color(255, 0, 0)); // Red strip.show(); delay(100...

Raspberry Pi Pico 2 W display on two 1.9" 170*320 ST7789 SPI LCD, using Arduino_GFX_Library, using separated SPI.

Image
Raspberry Pi Pico 2 W display on two 1.9" 170*320 ST7789 SPI LCD, using Arduino_GFX_Library, using separated SPI. In previous exercise, I used a Raspberry Pi Pico 2 W to drive two LCDs: a 2.4-inch and a 2.0-inch 240×320 ST7789 SPI IPS . Both displays shared a common SPI bus without any problems. However, when I replaced them with two 1.9-inch 170×320 ST7789 SPI LCDs , the setup did not work. Using the same code and connections, only the second LCD would turn on. To solve this, I separated the SPI connections for the two displays: the first one (on the left) is connected via Arduino_RPiPicoSPI, and the second one (on the right) is connected via Arduino_SWSPI. Updated connection: Raspberry Pi Pico 2 W      GP28| LCD2_RST -----------------+      GND | |      GP27| LCD2_DC ----------------+ |      GP26| LCD2_CS --------------+ | |      Run | ...

Raspberry Pi Pico 2 W display on dual LCD using Arduino_GFX_Library (Arduino Framework), common SPI.

Image
Raspberry Pi Pico 2 W display on dual LCD using Arduino_GFX_Library.  - 2.4 inch 240×320 ST7789 SPI IPS - 2.0 inch 240x320 ST7789 SPI IPS Connection: Connection ==========      Raspberry Pi Pico 2 W | GP28| ------- LCD2_RST -----------------+      GND | |      GP27| ------- LCD2_DC ----------------+ |      GP26| ------- LCD2_CS --------------+ | |      Run | | | |      GP22| ------- LCD_RST ------+ | | |      GND | | | | |      GP21| ------- LCD_DC -------|-+ | | |      GP20| ------- LCD_BL -------|-|---+ | | |      GP19| MOSI - SPI_SDA ----+ | | | | | |      GP18| SCK - SPI_SCL --+ | | | | | | |      GND |      | | | | | | | |      GP17| SS - LCD_CS ---|-|-|-|-+ | | | ...

Xiao ESP32S3 display on 240*240 ST7789 SPI LCD/FT6236U cap. touch using TFT_eSPI in Arduino Framework.

Image
This video show steps how Xiao ESP32S3 display on 1.54" 240*240 ST7789 SPI LCD using TFT_eSPI in Arduino Framework. Connection: ST7789V2 Xiao ESP32S3 ---------------------------- 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 Library used: TFT_eSPI  https://github.com/Bodmer/TFT_eSPI To setup, scroll down to "Tips" section: Create a new folder in your Arduino library folder called "TFT_eSPI_Setups". You then place your custom setup.h files in there. Edit the User_Setup_Select.h file to point to your custom setup file. Create my custom setup file, Setup_ST7789_XIAOESP32S3.h , under TFT_eSPI_Setups folder. // Setup_ST7789_XIAOESP32S3.h in // ..\Arduino\libraries\TFT_eSPI_Setups\ // // Modify // ..\Arduino\libraries\TFT_eSPI\User_Setup_Select.h to load it. // #include <../TFT_eSPI_Setups/Setup_ST7789_XIAOESP32S3.h> #de...

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...