Skip to content

Commit f850808

Browse files
committed
Add Heltec Vision Master T190 board
Add User setup preset Add example for using 170x320 TFT screen
1 parent 5793878 commit f850808

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed

User_Setup_Select.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@
143143

144144
//#include <User_Setups/Setup301_BW16_ST7735.h> // Setup file for Bw16-based boards with ST7735 160 x 80 TFT
145145
//#include <User_Setups/Setup302_Waveshare_ESP32S3_GC9A01.h> // Setup file for Waveshare ESP32-S3-Touch-LCD-1.28 board with GC9A01 240*240 TFT
146+
//#include <User_Setups/Setup303_Waveshare_VisionMaster_T190.h> // Setup file for Heltec Vision Master T190 board with ST7789 TFT-LCD 170x320 display
146147

147148
//#include <User_Setups/SetupX_Template.h> // Template file for a setup
148149

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// See SetupX_Template.h for all options available
2+
#define USER_SETUP_ID 303
3+
4+
// Full configuration option, define additional parameters below for this display
5+
#define ST7789_DRIVER
6+
7+
#define USE_HSPI_PORT
8+
9+
// Colour order Blue-Green-Red
10+
#define TFT_RGB_ORDER TFT_BGR
11+
12+
#define TFT_MOSI 48
13+
#define TFT_SCLK 38
14+
#define TFT_CS 39 // Chip select control pin
15+
#define TFT_DC 47 // Data Command control pin
16+
#define TFT_RST 40 // Reset pin (could connect to RST pin)
17+
#define TFT_BL 17
18+
#define TFT_BACKLIGHT_ON HIGH
19+
#define LCD_CONTROL_PIN 7
20+
21+
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
22+
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
23+
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
24+
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
25+
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
26+
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
27+
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
28+
#define SMOOTH_FONT
29+
30+
#define TFT_WIDTH 170
31+
#define TFT_HEIGHT 320
32+
33+
#define SPI_FREQUENCY 32000000
34+
35+
#define SPI_READ_FREQUENCY 20000000
36+
37+
#define SPI_TOUCH_FREQUENCY 2500000
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#include <TFT_eSPI.h> // Include the graphics library
2+
3+
TFT_eSPI tft = TFT_eSPI(); // Create an instance of the library
4+
5+
void setup() {
6+
pinMode(LCD_CONTROL_PIN, OUTPUT);
7+
digitalWrite(LCD_CONTROL_PIN, LOW);
8+
9+
// Initialize the backlight pin
10+
pinMode(TFT_BL, OUTPUT);
11+
digitalWrite(TFT_BL, HIGH); // Turn on the backlight (HIGH = ON)
12+
13+
// Initialize the display
14+
tft.init();
15+
tft.setRotation(1); // Set rotation for landscape/portrait orientation (0-3)
16+
17+
// Clear the screen with a background color
18+
tft.fillScreen(TFT_BLACK);
19+
20+
// Set text color and background color
21+
tft.setTextColor(TFT_WHITE, TFT_BLACK);
22+
23+
// Set text size
24+
tft.setTextSize(2);
25+
26+
// Display some text
27+
tft.setCursor(10, 10); // Set the cursor position
28+
tft.println("Hello, World!");
29+
30+
// Display additional text
31+
tft.setTextColor(TFT_YELLOW, TFT_BLACK);
32+
tft.setTextSize(3);
33+
tft.setCursor(10, 50);
34+
tft.println("ST7789 Screen!");
35+
36+
// Draw some additional decorative elements (optional)
37+
tft.drawRect(1, 1, tft.width() - 1, tft.height() - 1, TFT_RED); // Red rectangle around text
38+
}
39+
40+
void loop() {
41+
// Nothing to do here for this example
42+
}

0 commit comments

Comments
 (0)