Giter VIP home page Giter VIP logo

jc4827w543_4.3inch_esp32s3_board's Introduction

JC4827W543_board

ESP32-S3 with 4.3' TFT 480x270 driver NV3041A and capacitive touch

Read Docs/Getting started.pdf

Board info via USB: u-blox NORA-W10 series (ESP32-S3)

JC4827W543_board JC4827W543_board

  • 4.3-inch LCD-TFT (display driver NV3041A 4-bit parallel)
  • Supports WiFi and Bluetooth
  • Support lithium battery power supply
  • Capacitive touch or Resistance touch (Capacitive touch driver GT911 I2C)
  • 480 x 272 screen resolution
  • RGB 65K 16 bit
  • Onboard 240MHz ESP32-S3-WROOM-1-N4R8 dual-core
  • integrated WI-FI and Bluetooth
  • 520K Byte RAM
  • 8 MB PSRAM (OSPI)
  • 4 MB Flash memory (QSPI)
  • Operating Voltage 5V
  • Power consumption 260 mA
  • Module size 120x70.2(mm)
  • Up to 10 IOs can be used
  • JST1.25 4 Pins

Product spec download links: http://www.jczn1688.com/zlxz

https://aliexpress.ru/item/1005006729657546.html

1.25mm 4pin 30cm, 1.25mm 2pin 30cm

https://aliexpress.ru/item/1005004837211340.html

JC4827W543_board

Arduino example 3_3-3_TFT-LVGL-Widgets

Select board:

  • u-blox NORA-W10 series (ESP32-S3)

OR

  • ESP32S3 Dev module

Need install library:

Move lv_conf.h file to ..../Arduino/libraries directory

WARNING: install lvgl ver 8.4.0 !!!

JC4827W543_board

Fast DMA drawing LVGL example

In lv_conf.h file set:

/*Swap the 2 bytes of RGB565 color. Useful if the display has an 8-bit interface (e.g. SPI)*/
#define LV_COLOR_16_SWAP 0

Example:

/*******************************************************************************
Created by profi-max (Oleg Linnik) 2024
https://profimaxblog.ru
https://github.com/profi-max

*******************************************************************************/
#include "lv_demo_widgets.h"
#include <Arduino_GFX_Library.h>
#include "touch.h"

// FOR ARDUINO Uncomment the line below if you wish debug messages
//#define CORE_DEBUG_LEVEL 4

// FOR VSCODE see platformio.ini file -D CORE_DEBUG_LEVEL=1

/***************************************************************************************************
 * Arduino_GFX Setup for JC4827W543C
 ***************************************************************************************************/
#define SCREEN_WIDTH 480
#define SCREEN_HEIGHT 272
#define SCR_BUF_LEN 32

// LCD backlight PWM 
#define LCD_BL 1           // lcd BL pin
#define LEDC_CHANNEL_0     0 // use first channel of 16 channels (started from zero)
#define LEDC_TIMER_12_BIT  12 // use 12 bit precission for LEDC timer
#define LEDC_BASE_FREQ     5000 // use 5000 Hz as a LEDC base frequency


Arduino_DataBus *bus = new Arduino_ESP32QSPI(
    45 /* cs */, 47 /* sck */, 21 /* d0 */, 48 /* d1 */, 40 /* d2 */, 39 /* d3 */);
Arduino_NV3041A *panel = new Arduino_NV3041A(bus, GFX_NOT_DEFINED /* RST */, 0 /* rotation */, true /* IPS */);
Arduino_GFX *gfx = new Arduino_Canvas(SCREEN_WIDTH /* width */, SCREEN_HEIGHT /* height */, panel);
//------------------------------- End TFT+TOUCH setup ------------------------------

static const char* logTAG = "main.cpp";

/***************************************************************************************************
 * LVGL functions
 ***************************************************************************************************/

//=====================================================================================================================
void IRAM_ATTR my_disp_flush_(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
{
  uint32_t w = (area->x2 - area->x1 + 1);
  uint32_t h = (area->y2 - area->y1 + 1);

  panel->startWrite();
  panel->setAddrWindow(area->x1, area->y1, w, h); 
  panel->writePixels((uint16_t *)&color_p->full, w * h);
  panel->endWrite();
  lv_disp_flush_ready(disp); /* tell lvgl that flushing is done */
}
//=====================================================================================================================
void IRAM_ATTR my_touchpad_read_(lv_indev_drv_t *indev_driver, lv_indev_data_t *data)
{
  if (touch_has_signal())
  {
    if (touch_touched())
    {
      data->state = LV_INDEV_STATE_PR;
      data->point.x = touch_last_x;
      data->point.y = touch_last_y;
    }
    else if (touch_released())
    {
      data->state = LV_INDEV_STATE_REL;
    }
  }
  else
  {
    data->state = LV_INDEV_STATE_REL;
  }
}
//=====================================================================================================================
void IRAM_ATTR my_touchpad_feedback_(lv_indev_drv_t *indev_driver, uint8_t data)
{
  // Beep sound here
}
//=====================================================================================================================
// value has to be between 0 and 255
void setBrightness(uint8_t value)
{
  uint32_t duty = 4095 * value / 255;
  ledcWrite(LEDC_CHANNEL_0, duty);
}
//=====================================================================================================================

/***************************************************************************************************
 * LVGL Setup
 ***************************************************************************************************/

//=====================================================================================================================
void lvgl_init()
{
  static lv_disp_draw_buf_t draw_buf;
  static lv_disp_drv_t disp_drv;
  static lv_color_t disp_draw_buf[SCREEN_WIDTH * SCR_BUF_LEN];
  //static lv_color_t disp_draw_buf2[SCREEN_WIDTH * SCR_BUF_LEN];

  // Setting up the LEDC and configuring the Back light pin
  ledcSetup(LEDC_CHANNEL_0, LEDC_BASE_FREQ, LEDC_TIMER_12_BIT);
  ledcAttachPin(LCD_BL, LEDC_CHANNEL_0);
  setBrightness(250);

   // Init Display
  if (!gfx->begin())
  {
    ESP_LOGI(logTAG, "gfx->begin() failed!\n");  
  }
  gfx->fillScreen(BLACK);

 
  touch_init(gfx->width(), gfx->height(), gfx->getRotation());
  lv_init(); 

  if (!disp_draw_buf)  ESP_LOGE(logTAG, "LVGL disp_draw_buf allocate failed!"); 
  else 
  {
    lv_disp_draw_buf_init(&draw_buf, disp_draw_buf, NULL, SCREEN_WIDTH * SCR_BUF_LEN);

    /* Initialize the display */
    lv_disp_drv_init(&disp_drv);
    disp_drv.hor_res = SCREEN_WIDTH;
    disp_drv.ver_res = SCREEN_HEIGHT;
    disp_drv.flush_cb = my_disp_flush_;
    disp_drv.draw_buf = &draw_buf;
    lv_disp_drv_register(&disp_drv);

    /* Initialize the input device driver */
    static lv_indev_drv_t indev_drv;
    lv_indev_drv_init(&indev_drv);
    indev_drv.type = LV_INDEV_TYPE_POINTER;
    indev_drv.read_cb = my_touchpad_read_;
    indev_drv.feedback_cb = my_touchpad_feedback_;
    lv_indev_drv_register(&indev_drv);
  }

   ESP_LOGI(logTAG, "Lvgl v%d.%d.%d initialized\n", lv_version_major(), lv_version_minor(), lv_version_patch());  
}
//=====================================================================================================================

void setup()
{
  Serial.begin(115200);
  lvgl_init();
  lv_demo_widgets();
  ESP_LOGI(logTAG, "Setup done");
}

//=====================================================================================================================
void loop()
{
  lv_timer_handler(); /* let the GUI do its work */
  delay(5);
}

//=====================================================================================================================

jc4827w543_4.3inch_esp32s3_board's People

Contributors

profi-max avatar

Stargazers

 avatar  avatar momo belia avatar Calin Tenitchi avatar Ethan avatar

Watchers

 avatar

Forkers

01god lexhit1

jc4827w543_4.3inch_esp32s3_board's Issues

The Demo_VSCode_Platformio can't run

The Demo_VSCode_Platformio compiles without errors in VSCode, but the firmware cannot be directly downloaded to the development board through PlatformIO. Downloading the firmware to the development board using ESPTOOL, and after pressing the RST button, the development board goes into a black screen and repeatedly restarts, which is specifically manifested by the repeated sound of USB being plugged and unplugged from the computer

Example didn't compile properly.

Hi,

Thanks for posting that! Sadly the example didn't compile properly, although installed lvgl 8.4.0.

Also, in the "Move lv_conf.h file to ..../Arduino/libraries directory", which lv_conf.h specifically? There are many. Should the specific lv_conf.h file in a demo's folder be used when compiling each specific demo, or is there one lv_conf.h that functions with all of the JC4827W543 boards?

Thanks in advance for explaining!

By the way, this board is the JC4827W543-C with the cap touch. PDF docs that came with this board said to set 16mb(128mb) in the tools menu on the Arduino IDE. Also said to use the esptool programmer and didn't mention USB CDC On. I know that such chinese electronics products are somewhat notorious for sometimes requiring non-chinese software engineers in the international community to solve the problems though, so those settings in the included docs may have not been optimal.

Also recommend opening a "Discussions" on this repo. That can encourage cautious people to get involved in a less official way than by opening an "issue".

Here is the Arduino IDE compiler error on the example in the ReadMe on this repo:
"/private/var/folders/mp/11mhd1nn4335gj46054knmxr0000gn/T/.arduinoIDE-unsaved202464-81432-wfmd7w.rdgta/sketch_jul4a/sketch_jul4a.ino:7:10: fatal error: lv_demo_widgets.h: No such file or directory
7 | #include "lv_demo_widgets.h"
| ^~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: lv_demo_widgets.h: No such file or directory"

Thought maybe grab that from an lvgl folder and try putting it in main Arduino libs dir, but prefer to do it the right way.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.