TELEMATICS_3.5"_TFT_Touch_LCD_Shield_SKU__DFR0387 - jimaobian/DFRobotWiki GitHub Wiki

TELEMATICS 3.5" TFT Touch LCD Shield

Introduction

For beginners to Arduino it can be daunting and risky to wire LCD driver circuits - one wrong connection and your component can be damaged. This LCD expansion board removes all the complications and risks. The TELEMATICS 3.5" TFT Touch LCD Shield is an Arduino compatible display designed by DFRobot, with a resolution of 320x480, three serial ports and one IIC interface. It is perfectly compatible with Arduino DUE, Mega1280/2560, and Bluno Mega1280/2560. There is an on-board voltage switch which supports changing the output voltage between 3.3V and 5V to ensure that it won't damage your DUE. In addition, the LCD shield comes with a MicroSD card slot on the back that can be used for data storage up to a maximum of 32GB. We also offer a variety of driver packages to help you implement different features.

center note: since the operating voltage of due and mega are different, the backlight brightness will change if you replace your arduino platform. please adjust the D8 PWM signal to control the brightness of the backlight

Specification

  • Screen Size: 3.5"
  • Resolution Ratio: 320x480
  • Power Supply: 5V
  • Output Voltage: 3.3/5V
  • Backlight Control Mode: D8 PWM signal
  • Supports MicroSD card (Up to 32GB)
  • Serial Ports: 3
  • IIC interface: 1
  • Compatible with Arduino Compatible DUE/Mega 1280/2560
  • Compatible with the Bluno Mega 1280/2560
  • Supports Touch Functionality
  • Dimensions: 100x57mm/3.93x2.24 inches
  • Weight: 70g

Board Overview

center|thumb|800px

:![center](image/warning_yellow.png "stylewikilink")}

Tutorial

Requirements

Sample Code 1

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

/*
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(){
}

Sample Code 2

In this section, we'll explain how to use the SD card with LCD screen.

/*
/*
This code is to teach you how to use SD library.

 Created 2016-4-8
 By Andy zhou <[email protected]>
 version:V1.0
*/
#include <Arduino.h>
#include <SPI.h>
#include <MultiLCD.h>
#include <SD.h>
#include "datalogger.h"

#define STATE_SD_READY 0x1
#define STATE_OBD_READY 0x2
#define STATE_GPS_CONNECTED 0x4
#define STATE_GPS_READY 0x8
#define STATE_MEMS_READY 0x10
#define STATE_GUI_ON 0x20

LCD_R61581 lcd;
CDataLogger logger;

byte state = 0;

bool checkSD()
{
    Sd2Card card;
    SdVolume volume;
    state &= ~STATE_SD_READY;
    pinMode(SS, OUTPUT);

    lcd.setFontSize(FONT_SIZE_MEDIUM);
    if (card.init(SPI_HALF_SPEED, SD_CS_PIN)) {
        const char* type;
        switch(card.type()) {
        case SD_CARD_TYPE_SD1:
            type = "SD1";
            break;
        case SD_CARD_TYPE_SD2:
            type = "SD2";
            break;
        case SD_CARD_TYPE_SDHC:
            type = "SDHC";
            break;
        default:
            type = "SDx";
        }

        lcd.print(type);
        lcd.write(' ');
        if (!volume.init(card)) {
            lcd.print("No FAT!");
            return false;
        }

        uint32_t volumesize = volume.blocksPerCluster();
        volumesize >>= 1; // 512 bytes per block
        volumesize *= volume.clusterCount();
        volumesize >>= 10;

        lcd.print((int)volumesize);
        lcd.print("MB");
    } else {
        lcd.println("No SD Card");
        return false;
    }

    if (!SD.begin(SD_CS_PIN)) {
        lcd.println("Bad SD");
        return false;
    }

    state |= STATE_SD_READY;
    return true;
}

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);
  if (checkSD()) {
        uint16_t index = logger.openFile();
        lcd.println();
        if (index > 0) {
            lcd.print("File ID:");
            lcd.println(index);
        } else {
            lcd.print("No File");
        }
    }
}

void loop(){
}

Sample Code 3

In this section, we'll explain how to use the touch function

#include <Arduino.h>
#include <SPI.h>
#include <MultiLCD.h>
#include "touch.h"

LCD_R61581 lcd;

void setup(){
  lcd.begin();
  lcd.setFontSize(FONT_SIZE_MEDIUM);  //set font size
  lcd.setColor(RGB16_YELLOW);  //set strings color
  lcd.println("DFRobot");
  lcd.println("TELEMATICS LCD SHIELD V1.0");
  lcd.println();
  lcd.setColor(RGB16_WHITE);

  touch.init();
}

void loop(){
  lcd.setCursor(0, 8);
  int x, y;
  if ( touch.read(x, y) ){
    lcd.print("X:");
    lcd.print(x);
    lcd.print(" Y:");
    lcd.print(y);
    lcd.print("  ");
  } else {
    lcd.print("           ");
  }
}

FAQ

center For any questions/advice/cool ideas to share, please visit DFRobot Forum.

More

Github Repository Arduino libraries Schematic link=http://www.dfrobot.com/ shopping from dfrobot store or dfrobot distributor.

⚠️ **GitHub.com Fallback** ⚠️