Codey OnlineLibreria di componenti Arduino ed ESP32 › 3.5 inch TFT LCD Shield
3.5 inch TFT LCD Shield
Sensori

3.5 inch TFT LCD Shield

Shield LCD TFT da 3,5 pollici per Arduino UNO e MEGA

Larghezza: 108.9 mm

Pinout — 3.5 inch TFT LCD Shield

Pin Segnale Descrizione
LCD_D2 data Parallel TFT LCD data bus bit 2 from the Arduino to the display controller.
LCD_D3 data Parallel TFT LCD data bus bit 3 from the Arduino to the display controller.
LCD_D4 data Parallel TFT LCD data bus bit 4 from the Arduino to the display controller.
LCD_D5 data Parallel TFT LCD data bus bit 5 from the Arduino to the display controller.
LCD_D6 data Parallel TFT LCD data bus bit 6 from the Arduino to the display controller.
LCD_D7 data Parallel TFT LCD data bus bit 7 from the Arduino to the display controller.
LCD_D0 data Parallel TFT LCD data bus bit 0 from the Arduino to the display controller.
LCD_D1 data Parallel TFT LCD data bus bit 1 from the Arduino to the display controller.
SD_SS chip-select MicroSD SPI slave-select/chip-select line; active low to select the card.
SD_DI MOSI MicroSD SPI data-in line; Arduino MOSI into the card.
SD_DO MISO MicroSD SPI data-out line; card MISO back to the Arduino.
SD_SCK SCK MicroSD SPI serial clock from the Arduino to the card.
LCD_CS chip-select TFT LCD chip-select input; active low to enable LCD command/data transfers.
LCD_RS digital TFT LCD register-select/data-command control line for the parallel interface.
LCD_WR clock TFT LCD write strobe; clocks Arduino data into the display controller.
LCD_RD clock TFT LCD read strobe; used when reading display controller data/status.
GND ground Ground reference for the LCD shield, microSD socket, and Arduino signals.
5V power 5 V supply input from the Arduino used to power the TFT shield circuitry.
3V3 power 3.3 V supply rail used by low-voltage shield circuitry such as the microSD interface.
J4.4 power Unlabeled power-side header contact passed through to the Arduino shield stack.
J4.5 power Unlabeled power-side header contact passed through to the Arduino shield stack.
J4.6 power Unlabeled power-side header contact passed through to the Arduino shield stack.
LCD_RST reset TFT LCD Reset

Schema di cablaggio di esempio — 3.5 inch TFT LCD Shield

Da A Filo
board:GND x1:GND black
board:5V x1:5V red
board:3.3V x1:3V3 darkorange
board:D2 x1:LCD_D2 green
board:D3 x1:LCD_D3 blue
board:D4 x1:LCD_D4 yellow
board:D5 x1:LCD_D5 purple
board:D6 x1:LCD_D6 cyan
board:D7 x1:LCD_D7 magenta
board:D8 x1:LCD_D0 brown
board:D9 x1:LCD_D1 pink
board:D10 x1:SD_SS teal
board:D11 x1:SD_DI lime
board:D12 x1:SD_DO green
board:D13 x1:SD_SCK blue
board:A0 x1:LCD_CS yellow
board:A1 x1:LCD_RS purple
board:A2 x1:LCD_WR cyan
board:A3 x1:LCD_RD magenta
board:A4 x1:LCD_RST brown

Codice Arduino di esempio — 3.5 inch TFT LCD Shield

Questo esempio è stato scritto e verificato in compilazione per arduino-uno. Codey Online lo adatta a qualsiasi altra scheda supportata.

#include <SPI.h>
#include <SD.h>

// Canonical beginner sketch for a 3.5 inch TFT LCD Shield wired to an Arduino Uno.
// This example demonstrates using the microSD slot with the built-in SD library.
// The TFT control/data pins are shown in the wiring block, but the sketch keeps the
// example simple by focusing on the shield's SD card interface.

const uint8_t SD_CS_PIN = 10;

void printDirectory(File dir, int numTabs) {
  while (true) {
    File entry = dir.openNextFile();
    if (!entry) {
      break;
    }

    for (int i = 0; i < numTabs; i++) {
      Serial.print('\t');
    }
    Serial.print(entry.name());
    if (entry.isDirectory()) {
      Serial.println('/');
      printDirectory(entry, numTabs + 1);
    } else {
      Serial.print('\t');
      Serial.println(entry.size(), DEC);
    }
    entry.close();
  }
}

void setup() {
  Serial.begin(9600);
  while (!Serial) {
    ;
  }

  Serial.println(F("3.5 inch TFT LCD Shield - SD card example"));
  Serial.print(F("Initializing SD card on CS pin D"));
  Serial.println(SD_CS_PIN);

  if (!SD.begin(SD_CS_PIN)) {
    Serial.println(F("SD card initialization failed!"));
    Serial.println(F("Check power, wiring, and that a card is inserted."));
    while (true) {
      delay(1000);
    }
  }

  Serial.println(F("SD card initialized successfully."));

  File root = SD.open("/");
  if (root) {
    Serial.println(F("Files on the card:"));
    printDirectory(root, 0);
    root.close();
  } else {
    Serial.println(F("Could not open root directory."));
  }
}

void loop() {
  // Nothing to do here for this basic example.
  delay(1000);
}

Componenti correlati

18650 Battery Shield with USB-C Charger and 5V Boost Converter

18650 Battery Shield with USB-C Charger and 5V Boost Converter

2.4 inch OLED Display I2C 3.3V

2.4 inch OLED Display I2C 3.3V

50kg Load Cell Weight Sensor

50kg Load Cell Weight Sensor

Accelerometer and Gyroscope I2C MPU-6050

Accelerometer and Gyroscope I2C MPU-6050

Crea il tuo progetto Arduino o ESP32 con l'AI

Descrivi cosa vuoi realizzare. Codey Online scrive il codice, disegna lo schema di collegamento, lo compila e programma la tua scheda direttamente dal browser.

Inizia gratis