Hello there..
I am using an Arduino Uno and a 3.5 TFT LCD with SD card.
The only problem i have is i am using the SD card on my Display and i want a simple code to set my image as an background so i can use the image with toutchscreen.. The point is after toutching it it will go to a screen with an other image..
Can some one please help so i can display an image in back ground
Here is the code so far:
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <TouchScreen.h>
#include <MCUFRIEND_kbv.h>
MCUFRIEND_kbv tft;
// Define some TFT readable colour codes to human readable names
#define BLACK 0x0000 /* 0, 0, 0 /
#define BLUE 0x001F / 0, 0, 255 /
#define RED 0xF800 / 255, 0, 0 /
#define GREEN 0x07E0 / 0, 255, 0 /
#define CYAN 0x07FF / 0, 255, 255 /
#define MAGENTA 0xF81F / 255, 0, 255 /
#define YELLOW 0xFFE0 / 255, 255, 0 /
#define WHITE 0xFFFF / 255, 255, 255 /
#define NAVY 0x000F / 0, 0, 128 /
#define DARKGREEN 0x03E0 / 0, 128, 0 /
#define DARKCYAN 0x03EF / 0, 128, 128 /
#define MAROON 0x7800 / 128, 0, 0 /
#define PURPLE 0x780F / 128, 0, 128 /
#define OLIVE 0x7BE0 / 128, 128, 0 /
#define LIGHTGREY 0xC618 / 192, 192, 192 /
#define DARKGREY 0x7BEF / 128, 128, 128 /
#define ORANGE 0xFD20 / 255, 165, 0 /
#define GREENYELLOW 0xAFE5 / 173, 255, 47 /
#define PINK 0xF81F / 255, 0, 255 */
#define REDBAR_MINX 80
#define GREENBAR_MINX 130
#define BLUEBAR_MINX 180
#define BAR_MINY 30
#define BAR_HEIGHT 250
#define BAR_WIDTH 30
#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
// from Kuman_SC3A
#define TS_MINX 85
#define TS_MAXX 925
#define TS_MINY 135
#define TS_MAXY 910
#define MINPRESSURE 10
#define MAXPRESSURE 1000
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
#define PALETTEDEPTH 0 // do not support Palette modes
void setup(void) {
Serial.begin(9600);
Serial.print(F("Finding out the type of TFT LCD... ID is : "));
tft.reset();
uint16_t identifier = tft.readID();
Serial.print(identifier, HEX);
tft.begin(identifier);
Serial.print(". TFT size is : "); Serial.print(tft.width()); Serial.print(" x "); Serial.println(tft.height());
tft.setRotation(1);
//tft.invertDisplay(1); // UNCOMMENT THIS IF COLORS get inverted
tft.fillScreen(BLACK);
Serial.println("Drawing Init Screen...");
drawInitScreen();
delay(100);
}
void loop(void) {
// i want a single image displayed from the sd card that is attached to my TFT screen
}
P.S::
Can you make the image fullscreen: 480x320?
