Showing posts with label LCD. Show all posts
Showing posts with label LCD. Show all posts

Tuesday, July 14, 2020

ESP32 + 1.3 inch 240x240 IPS LCD (ST7789 SPI interface), using TFT_eSPI library



It's a 1.3 inch 240x240 IPS LCD, with driver ST7789 using SPI interface.

7 pins are used to connect to MCU:

# Pin Label Description
1 GND LCD Power ground
2 VCC LCD power supply is positive (3.3V)
3 SCL LCD SPI bus clock signal - connect to ESP32 18 TFT_SCLK
4 SDA LCD SPI bus write data signal - connect to ESP32 23 TFT_MOSI
5 RES  LCD reset control signal(Low level reset) - connect to ESP32 4 TFT_RST
6 DC   LCD register/data - connect to EST32 2 TFT_DC
7 BLK LCD backlight control signal - Connect to 3.3V


Product page: lcdwiki : 1.3inch IPS Module

This video show how to setup on Arduino IDE, using TFT_eSPI library on ESP32 (ESP32-DevKitC), to drive the 1.3 inch 240x240 IPS LCD.


Using TFT_eSPI, if you load a new copy of TFT_eSPI then it will over-write your setups if they are kept within the TFT_eSPI folder. It's suggested to create a new folder in your Arduino library folder called "TFT_eSPI_Setups". You then place your custom setup.h (Setup24_ST7789_ESP32.h in my exercise) files in there. After an upgrade simply edit the User_Setup_Select.h file to point to your custom setup file. (ref: https://github.com/Bodmer/TFT_eSPI)

- Makesure TFT_eSPI library is installed in Arduino IDE.
- Create "TFT_eSPI_Setups" folder under your Arduino library folder.
- Copy the file TFT_eSPI/User_Setups/Setup24_ST7789.h to TFT_eSPI_Setups folder, re-name it Setup24_ST7789_ESP32.h.

- Edit Setup24_ST7789_ESP32.h to match our connection:


- Edit User_Setup_Select.h file to point to the custom setup file, Setup24_ST7789_ESP32.h.


- Then you can try examples of TFT_eSPI.



Thursday, June 16, 2016

3.2" 480 x 320 TFT LCD Shield, install UTFT library and test with Arduino Mega 2560

It's 3.2" 480 x 320 TFT color screen support Arduino Mega 2560, named QDM320B.








According to the seller:

Overview
QD320DB16NT8357RA module is 3.2" TFT LCD with 262K color 480x320 resolutions.
The controller of this LCD module is HX8357B, it supports 16-wires DataBus interface. Moreover, this module includes the 5V -3.3V power conversion circuit and Level Level conversion circuit, This Module can Directly inserted into the Arduino Mega2560 Board, it also includes the SD card socket and SPI FLASH circuit.

Features

  • Support Arduino Mega2560 Directly inserted
  • With Full-angle IPS TFT panel
  • OnBorad level conversion chip for 5V/3.3V MCU
  • Compatible with 3.3/5V operation voltage level
  • Compatible with Arduino-Series development Board.
  • Compatible with UTFT / UTFT_Buttons /Utouch Library for arduino.
  • provided 12-examples with Arduino ,3-examples with STM32 
  • With SD Card Socket
  • With SPI FLASH circuit



This video show how to install UTFT library (from http://www.rinkydinkelectronics.com/) and test example on Arduino Mega 2560.


More examples:
Draw bitmap on 3.2" 480 x 320 TFT LCD Shield using UTFT
Arduino Mega read string from Serial, display on 3.2" 480 x 320 TFT LCD Shield

Wednesday, May 11, 2016

I2C 4x20 LCD, test on Arduino Uno using LiquidCrystal_I2C library




Test I2C 4x20 LCD on Arduino Uno using LiquidCrystal_I2C library. marcoschwartz/LiquidCrystal_I2C is a LiquidCrystal Arduino library for the DFRobot I2C LCD displays.

- Install LiquidCrystal_I2C library in Arduino Software:


- Open the example of LiquidCrystal_I2C > HelloWorld


//YWROBOT
//Compatible with the Arduino IDE 1.0
//Library version:1.1
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,20,4);  // set the LCD address to 0x27 for a 16 chars and 2 line display

void setup()
{
  lcd.init();                      // initialize the lcd 
  lcd.init();
  // Print a message to the LCD.
  lcd.backlight();
  lcd.setCursor(3,0);
  lcd.print("Hello, world!");
  lcd.setCursor(2,1);
  lcd.print("Ywrobot Arduino!");
   lcd.setCursor(0,2);
  lcd.print("Arduino LCM IIC 2004");
   lcd.setCursor(2,3);
  lcd.print("Power By Ec-yuan!");
}


void loop()
{
}

Test with Arduino Uno:
Uno A4 (SDA) - SDA
Uno A5 (SCL) - SCL
Uno +5V - VCC
Uno GND - GND

Remark:
- It's a jumper on the daughter board on the back side, it have to be insert (short) to turn on the back light.
- Most probably you have to adjust the potentiometer on the daughter board to make the LCD characters clear.
- The I2C address of the board is 0x27, you can check it with i2cdetect library.


Friday, September 26, 2014

Esplora TFT work on Arduino Uno

The Arduino TFT screen is a backlit LCD screen with headers, designed to fit Arduino Esplora or the Arduino Robot. This module is also compatible with any AVR-based Arduino (Uno, Leonardo, etc...) or with the Arduino Due. Read Connecting to other Arduino boards for more details.

This example, TFTGraph, run on Arduino Uno board, reads the value of analog input on A0, and graphs the values on the screen.


To connect Arduino TFT to Arduino Uno board:


Run example of TFTGraph example from Arduino IDE, File > Examples > TFT > Arduino > TFTGraph.

/*

 TFT Graph

 This example for an Arduino screen reads
 the value of an analog sensor on A0, and
 graphs the values on the screen.

 This example code is in the public domain.

 Created 15 April 2013 by Scott Fitzgerald

 http://arduino.cc/en/Tutorial/TFTGraph

 */

#include <TFT.h>  // Arduino LCD library
#include <SPI.h>

// pin definition for the Uno
#define cs   10
#define dc   9
#define rst  8

// pin definition for the Leonardo
// #define cs   7
// #define dc   0
// #define rst  1

TFT TFTscreen = TFT(cs, dc, rst);

// position of the line on screen
int xPos = 0;

void setup() {
  // initialize the serial port
  Serial.begin(9600);

  // initialize the display
  TFTscreen.begin();

  // clear the screen with a pretty color
  TFTscreen.background(250, 16, 200);
}

void loop() {
  // read the sensor and map it to the screen height
  int sensor = analogRead(A0);
  int drawHeight = map(sensor, 0, 1023, 0, TFTscreen.height());

  // print out the height to the serial monitor
  Serial.println(drawHeight);

  // draw a line in a nice color
  TFTscreen.stroke(250, 180, 10);
  TFTscreen.line(xPos, TFTscreen.height() - drawHeight, xPos, TFTscreen.height());

  // if the graph has reached the screen edge
  // erase the screen and start again
  if (xPos >= 160) {
    xPos = 0;
    TFTscreen.background(250, 16, 200);
  }
  else {
    // increment the horizontal position:
    xPos++;
  }

  delay(16);
}


Wednesday, January 22, 2014

Insert LCD screen on Arduino Esplora

This post show how to insert optional LCD screen on Arduino Esplora board in right direction.

Refer to "Esplora Pinout Diagram", there are two connectors on Esplora board, the TFT display connector is located on the right side, for optional color LCD screen, SD card, or other devices that use the SPI protocol. On your LCD board, there should be some marking, something GND, BL, RESET...+5V... on the LCD connector. Just insert the LCD screen in the direction to match the connectors.

Sunday, May 19, 2013

Nokia 5110 84X48 LCD display@Arduino Uno

How to use the Nokia 5110 84X48 LCD display with Arduino
This is the Nokia 5110 84X48 display that was used on millions of phones in the late 90's. In this video, the video show how to connect the Nokia 5110 LCD to an Arduino Uno, import the correct libraries to the Arduino IDE, and write code to generate text and graphics on the display.

Wednesday, March 6, 2013

LCD Demo: Arduino DUE vs Mega 2560

Arduino DUE and Mega 2560 with CTE 3.2" TFT LCD Module with Font IC Demo

Up: Arduino DUE w/TFT Shield
Down: Mega 2560 w/TFT Shield

Running the same demo code with Coldtears electronics 3.2" TFT LCD Module with font and icon IC

The first part is demo of the displaying text and icons from the module. The module is a 3.2" LCD module with fonts of 10 sizes and some commonly used icon for application development.

The second part is the famous UTFT demo by Henning Karlson. DUE runs at 84Mhz with SPI DMA, mega runs at 16Mhz, As seen due is incredibly faster when loading data from flash and drawing to the LCD