bonjour a tous , j'essai en vain d'afficher une image bmp ou raw sur un écran TFT ..
je reussi bien a charger des images de la SD . mais le résultat est dégelasse ... je ne comprend pas
// Master Binder v2 telecommande
#include <XBee.h>
#include <UTFT.h>
#include <URTouch.h>
#include <Adafruit_GFX.h>
#include <SPI.h>
#include <SD.h>
//////////////////////////////////////////////////////////////////////
//sd
// Chip select may be constant or RAM variable.
const uint8_t SD_CS_PIN = 53;
//
// Pin numbers in templates must be constants.
const uint8_t SOFT_MISO_PIN = 35;
const uint8_t SOFT_MOSI_PIN = 37;
const uint8_t SOFT_SCK_PIN = 36;
//ecran tft
//model,cs,cd/rs,wr,rd,reset// rs option
UTFT myGLCD(ITDB32S,38,39,40,41);
// ecran tactil
URTouch myTouch( 6, 5, 4, 3, 2);
//myGLCD.begin();
//UTFT.InitLCD(240, 320);
//
// Declare which fonts we will be using
extern uint8_t BigFont[];
extern uint8_t SmallFont[];
unsigned long tempoenvoi = 0;
int tempoaffich = 1000;
#define NOIR 0, 0, 0
#define NAVY 0, 0, 123
#define DARKGREEN 0, 125, 0
#define DARKCYAN 0, 125, 123
#define MAROON 123, 0, 0
#define PURPLE 123, 0, 123
#define OLIVE 123, 125, 0
#define LIGHTGREY 198, 195, 198
#define DARKGREY 123, 125, 123
#define BLUE 0, 0, 255
#define GREEN 0, 255, 0
#define CYAN 0, 255, 255
#define RED 255, 0, 0
#define MAGENTA 255, 0, 255
#define YELLOW 255, 255, 0
#define BLANC 255, 255, 255
#define ORANGE 255, 165, 0
#define GREENYELLOW 0 173, 255, 41
#define PINK 255, 130, 198
const int nbOutil = 9;
char* outil[nbOutil] = {"VIDE" ,"NANOPIX", "CAM_TH","ORCA" , "MULTI G" , "CAM360", "outil1","outil2","outil3"};
String Puce = " SUPER V2";
// 320 x 240
//const int nbOutil = 9;
const int nbdim = 5;
//File myFile;
//UTFT_SdRaw myFile(&myGLCD);
void setup()
{
tempoenvoi = millis();
Serial.begin(115200);
//////////////////////////
/*
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
*/
Serial.print("Initializing SD card...");
// see if the card is present and can be initialized:
if (!SD.begin(53)) {
Serial.println("Card failed, or not present");
// don't do anything more:
while (1);
}
Serial.println("card initialized.");
delay(2000);
///////////////////////////////
int xscreen = 0; // largeur ecrant
int yscreen = 0;
myGLCD.InitLCD (LANDSCAPE);//(PORTRAIT);//(LANDSCAPE);//
myGLCD.clrScr();
myTouch.InitTouch();
myTouch.setPrecision(PREC_MEDIUM);
xscreen = myGLCD.getDisplayXSize();
yscreen = myGLCD.getDisplayYSize();
myGLCD.clrScr();
delay(2000);
myGLCD.setFont(SmallFont);//(BigFont);
myGLCD.setColor(BLANC);
myGLCD.setBackColor(NOIR);
}
void loop()
{
/*
myGLCD.drawBitmap(10,20,"miniwoof.bmp",160,120);
delay(5000);
myGLCD.drawBitmap(10,20,"miniwoof.bmp",120,120,160);
delay(5000);
*/
//myFile.load(0,0,120,160,"miniwoof.bmp",1,0);
myGLCD.clrScr();
myGLCD.drawBitmap(10,20,"miniwoof.bmp",120,160);
myGLCD.print("miniwoof.bmp",10,20);
delay(5000);
myGLCD.clrScr();
myGLCD.drawBitmap(0,0,"test.bmp",240,320);
myGLCD.print("test.bmp",10,20);
delay(5000);
myGLCD.clrScr();
myGLCD.drawBitmap(0,0,"tiger.raw",240,320,1);
myGLCD.print("tiger.raw",10,20);
delay(5000);
myGLCD.clrScr();
myGLCD.drawBitmap(2,2,"ced.bmp",240,320);
myGLCD.print("ced",10,20);
delay(5000);
}
si quelqu'un pouvais m'aider .... je ne sait plus quoi tenter
merci