Example Code for Arduino-3.5 TFT LCD Display String
Last revision 2025/12/24
In this section, we'll explain how to initialize the LCD screen. You can use "setFontSize" and "setColor" function to change the font and the color of the characters.
Hardware Preparation
Software Preparation
- Download Arduino IDE: Click to download Arduino IDE
- Download the DFRobot_TELEMATICS_3.5-_TFT_Touch_LCD_Shield library: DFRobot_TELEMATICS_3.5-_TFT_Touch_LCD_Shield library
- About how to install the library?
Note: This library only works on Classic Arduino IDE 1.0.x)
/*
This code will demonstrate how to make the LCD display string with the library
If you need to set the font size, you can call this function "setFontSize()",and you can set the parameters:
FONT_SIZE_SMALL
FONT_SIZE_MEDIUM
FONT_SIZE_LARGE
FONT_SIZE_XLARGE
If you want to set the font color, you can call this function "setColor()" with the parameters:
RGB16_RED-------->RED
RGB16_GREEN------>GREEN
RGB16_BLUE------->BLUE
RGB16_YELLOW----->YELLOW
RGB16_CYAN------->CYAN
RGB16_PINK------->PINK
RGB16_WHITE------>WHITE
Created 2016-4-8
By Andy zhou <[email protected]>
version:V1.0
*/
#include <Arduino.h>
#include <SPI.h>
#include <MultiLCD.h>
LCD_R61581 lcd;
void setup(){
lcd.begin();
lcd.setFontSize(FONT_SIZE_MEDIUM); //set font size
lcd.setColor(RGB16_RED); //set strings color
lcd.println();
lcd.println();
lcd.println("DFRobot!!!");
lcd.println("TELEMATICS LCD SHIELD V1.0");
lcd.println();
lcd.setColor(RGB16_WHITE);
}
void loop(){
}
Was this article helpful?
