what is the preferred format of microSD?
which example would I use to test the shield with microSD?
the shield works fine and prints word in the TFT screen with this code
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_TFTLCD.h> // LCD library
#include <TouchScreen.h> // Touchscreen Library
#include <MCUFRIEND_kbv.h> // Touchscreen Hardware-specific library
#define LCD_CS A3 // Chip Select goes to Analog 3
#define LCD_CD A2 // Command/Data goes to Analog 2
#define LCD_WR A1 // LCD Write goes to Analog 1
#define LCD_RD A0 // LCD Read goes to Analog 0
#define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin
// Assign human-readable names to some common 16-bit color values:
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
// Color definitions
#define ILI9341_BLACK 0x0000 /* 0, 0, 0 */
#define ILI9341_NAVY 0x000F /* 0, 0, 128 */
#define ILI9341_DARKGREEN 0x03E0 /* 0, 128, 0 */
#define ILI9341_DARKCYAN 0x03EF /* 0, 128, 128 */
#define ILI9341_MAROON 0x7800 /* 128, 0, 0 */
#define ILI9341_PURPLE 0x780F /* 128, 0, 128 */
#define ILI9341_OLIVE 0x7BE0 /* 128, 128, 0 */
#define ILI9341_LIGHTGREY 0xC618 /* 192, 192, 192 */
#define ILI9341_DARKGREY 0x7BEF /* 128, 128, 128 */
#define ILI9341_BLUE 0x001F /* 0, 0, 255 */
#define ILI9341_GREEN 0x07E0 /* 0, 255, 0 */
#define ILI9341_CYAN 0x07FF /* 0, 255, 255 */
#define ILI9341_RED 0xF800 /* 255, 0, 0 */
#define ILI9341_MAGENTA 0xF81F /* 255, 0, 255 */
#define ILI9341_YELLOW 0xFFE0 /* 255, 255, 0 */
#define ILI9341_WHITE 0xFFFF /* 255, 255, 255 */
#define ILI9341_ORANGE 0xFD20 /* 255, 165, 0 */
#define ILI9341_GREENYELLOW 0xAFE5 /* 173, 255, 47 */
#define ILI9341_PINK 0xF81F
/******************* UI details */
#define BUTTON_X 52
#define BUTTON_Y 150
#define BUTTON_W 80
#define BUTTON_H 45
#define BUTTON_SPACING_X 26
#define BUTTON_SPACING_Y 30
#define BUTTON_TEXTSIZE 3
// Define pins for resistive touchscreen
#define YP A2 // must be an analog pin, use "An" notation!
#define XM A3 // must be an analog pin, use "An" notation!
#define YM 8 // can be a digital pin
#define XP 9 // can be a digital pin
// Define touchscreen pressure points
#define MINPRESSURE 10
#define MAXPRESSURE 1000
// Define touchscreen parameters
// Use test sketch to refine if necessary
#define TS_MINX 130
#define TS_MAXX 905
#define TS_MINY 75
#define TS_MAXY 930
#define STATUS_X 10
#define STATUS_Y 65
//Define LED outputs
#define RED_LED 51
#define GRN_LED 49
#define BLU_LED 47
// Define button state variables
boolean RED_state = 0;
boolean GRN_state = 0;
boolean BLU_state = 0;
// Define button array object
Adafruit_GFX_Button buttons[3];
// Define arrays with button text and colors
char buttonlabels[3][5] = {"R"};
uint16_t buttoncolors[6] = {ILI9341_RED, ILI9341_GREEN, ILI9341_BLUE};
// Define object for TFT (LCD)display
MCUFRIEND_kbv tft;
// Define object for touchscreen
// Last parameter is X-Y resistance, measure or use 300 if unsure
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
void setup(void) {
Serial.begin(9600);
Serial.println(F("TFT LCD test"));
pinMode(RED_LED, OUTPUT);
pinMode(GRN_LED, OUTPUT);
pinMode(BLU_LED, OUTPUT);
tft.reset();
uint16_t identifier = tft.readID();
if (identifier == 0x9325) {
Serial.println(F("Found ILI9325 LCD driver"));
} else if (identifier == 0x9328) {
Serial.println(F("Found ILI9328 LCD driver"));
} else if (identifier == 0x4535) {
Serial.println(F("Found LGDP4535 LCD driver"));
} else if (identifier == 0x7575) {
Serial.println(F("Found HX8347G LCD driver"));
} else if (identifier == 0x9341) {
Serial.println(F("*Found ILI9341 LCD driver"));
} else if (identifier == 0x7783) {
Serial.println(F("Found ST7781 LCD driver"));
} else if (identifier == 0x8230) {
Serial.println(F("Found UC8230 LCD driver"));
}
else if (identifier == 0x8357) {
Serial.println(F("Found HX8357D LCD driver"));
} else if (identifier == 0x0101)
{
identifier = 0x9341;
Serial.println(F("Found 0x9341 LCD driver"));
} else if (identifier == 0x9481)
{
Serial.println(F("Found 0x9481 LCD driver"));
}
else if (identifier == 0x9486)
{
Serial.println(F("Found 0x9486 LCD driver"));
}
else {
Serial.print(F("Unknown LCD driver chip: "));
Serial.println(identifier, HEX);
identifier = 0x9486;
}
// Setup the Display
tft.begin(identifier);
Serial.print("TFT size is "); Serial.print(tft.width()); Serial.print("x"); Serial.println(tft.height());
tft.setRotation(0);
tft.fillScreen(BLACK);
}
void loop(void) {
digitalWrite(13, HIGH);
TSPoint p = ts.getPoint();
digitalWrite(13, LOW);
// if sharing pins, you'll need to fix the directions of the touchscreen pins
pinMode(XM, OUTPUT);
pinMode(YP, OUTPUT);
tft.setCursor(30,100);
tft.setTextColor(0x07E0,0x0000);
tft.setTextSize(3);
tft.println(" hello");
tft.setCursor(10,150);
tft.setTextColor(0xFFE0,0x0000);
tft.setTextSize(3);
tft.println(" hi ");
tft.setCursor(10,200);
tft.setTextColor(0x780F,0x0000);
tft.setTextSize(3);
tft.println(" welcome");
tft.setCursor(10,250);
tft.setTextColor(0xF800,0x0000);
tft.setTextSize(3);
tft.println(" good");
tft.setCursor(30,300);
tft.setTextColor(0xFD20,0x0000);
tft.setTextSize(3);
tft.println(" wow ");
delay(100); // UI debouncing
}
.
so the problem is the SDcard not detected by the Arduino.
by the way, I use this circuit :
https://ram-e-shop.com/?s=lcd&product_cat=0&post_type=product
and if there is any way to display an image on TFT without using a microSD card?