Bonjour !
Je suis entrain de upgrader un kit pip boy avec un écran "fonctionnel", grâce au code de MattiusMatt. J'ai donc acheté un module lcd pas cher sur Aliexpress (oui je sais, c'est pas terrible), j'ai un peu changé le programme et contre toutes attentes, ça marche, à peu près...
En effet, le programme s'arrête au moment où il faut afficher une image bmp, j'en ai donc déduis que le problème se trouvait là. Je vous ai mis le début du code + une vidéo.
Arduino uno + module ci : https://fr.aliexpress.com/item/32905829057.html?spm=a2g0s.9042311.0.0.78586c37y42gDl
(J'ai mis qu'une première partie, ça bug au "// Vault Boy Loading", donc au moment où il veut afficher une image)
#include <Adafruit_TFTLCD.h>
#include <Adafruit_GFX.h>
#include <SPI.h>
#include <SD.h>
// Comment here when I know what this is for??
#if defined(__SAM3X8E__)
#undef __FlashStringHelper::F(string_literal)
#define F(string_literal) string_literal
#endif
// ASCII Consts
#define ASCII_CR 13
#define ASCII_LF 10
#define ASCII_PIPE 124
#define ASCII_TILDE 126
#define ASCII_B 66
#define ASCII_M 77
// TFT Pins
#define LCD_CS A3
#define LCD_CD A2
#define LCD_WR A1
#define LCD_RD A0
#define LCD_RESET A4
// SD Pin
#define SD_CS 10
// GPS
#define GPS_SCREEN 3
// Radio
#define RADIO_SCREEN 4
// Pip Screens
const char PIP_0[] = "0.pip";
const char PIP_1[] = "1.pip";
const char PIP_2[] = "2.pip";
const char PIP_3[] = "3.pip";
const char PIP_4[] = "4.pip";
#define TS_MINX 204
#define TS_MINY 195
#define TS_MAXX 948
#define TS_MAXY 910
// PIP Colours
#define GREEN 0x07E0
#define BLACK 0x0000
// TFT
Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
// Initialisation
void setup() {
// Debug using serial
Serial.begin(9600);
if (!enableSD()) { return; }
if (!enableTFT()) { return; }
runLoadSequence();
}
bool enableSD() {
//Serial.print(F("Initialising SD card..."));
if (!SD.begin(SD_CS)) {
Serial.println(F("SD failed!"));
return false;
}
//Serial.println(F("SD Initialised!"));
return true;
}
bool enableTFT() {
//Serial.println(F("Initialising TFT"));
// TFT
tft.begin(0x7575);
tft.setRotation(1);
tft.setTextColor(0x07E0);
tft.setTextSize(1);
return true;
}
void runLoadSequence() {
//Serial.println(F("Running load sequence"));
// Splash 0
tft.fillScreen(0x0000);
loadText("0.txt", 0, 0, 0);
delay(1000);
// Loading
tft.fillScreen(0x0000);
loadText("1.txt", 0, 0, 20);
//Serial.print("Free RAM: "); Serial.println(getFreeRam(), DEC);
delay(1000);
// Vault Boy Loading
tft.fillScreen(0x0000);
bmpDraw("l.bmp", 95, 35);
delay(1000);
}
Le lien pour voir la vidéo : https://drive.google.com/file/d/1KBXa9LavJBRG2lDj1ptzSSdYdd-wWhr3/view?usp=sharing
Merci pour votre aide !! Au passage, si vous voulez suivre le projet, ma page facebook : Raphi corp.
