Changer mon code lcd pour un ecran UTFT

bonjour a tous

je vous explique mon petit probléme

Voila je fait partie d’une association d’airsoft pour expliquer on fai de la simulation militaire

J’ai déjà un code nous permétant d’avoir une bombe factice avec capture de drapeaux
Nous souhaiterions l’améliorer un peut

le code est fait pour un ecran 16x2 lcd nous voudrion mettre un ecran tactile UTFT myGLCD comment faire je vous mai ci joint le code de l’écran et le lien du code de la bombe si quelqu’un peut me faire sa et surtout éxpliquer comment il a fait sa serai tres sympa de sa part .

je compte sur votre aide merci tous et toute

mon ecran

UTFT myGLCD(ITDB32S, 38, 39, 40, 41);


encore merci si j’ai de laide

BombPro.zip (66 KB)

Salut,

Bin faut modifier tout le reste du code … A moins que UTFT utilise exactement les même méthodes et la il suffit de juste déclarer :

UTFT lcd(ITDB32S, 38, 39, 40, 41);

Si anciennement dans ton code ton LCD s’appelait lcd

jai essayer cettte methode sa me donne sa

BombPro.ino:19:1: error: 'UTFT' does not name a type
BombPro.ino: In function 'void setup()':
BombPro.ino:105:3: error: 'lcd' was not declared in this scope
BombPro.ino: In function 'void disarmedSplash()':
BombPro.ino:240:5: error: 'lcd' was not declared in this scope
BombPro.ino:250:3: error: 'lcd' was not declared in this scope
BombPro.ino: In function 'void explodeSplash()':
BombPro.ino:287:3: error: 'lcd' was not declared in this scope
domination.ino: In function 'void domination()':
domination.ino:55:7: error: 'lcd' was not declared in this scope
domination.ino:62:7: error: 'lcd' was not declared in this scope
domination.ino:85:17: error: 'lcd' was not declared in this scope
domination.ino:86:7: error: 'lcd' was not declared in this scope
domination.ino:139:18: error: 'lcd' was not declared in this scope
domination.ino:140:7: error: 'lcd' was not declared in this scope
domination.ino:185:18: error: 'lcd' was not declared in this scope
domination.ino:186:7: error: 'lcd' was not declared in this scope
domination.ino: In function 'void gameOver()':
domination.ino:241:5: error: 'lcd' was not declared in this scope
domination.ino:286:3: error: 'lcd' was not declared in this scope
keys.ino: In function 'void setCode()':
keys.ino:42:3: error: 'lcd' was not declared in this scope
keys.ino: In function 'void setCodeTime()':
keys.ino:75:7: error: 'lcd' was not declared in this scope
keys.ino: In function 'void setPass()':
keys.ino:98:3: error: 'lcd' was not declared in this scope
keys.ino: In function 'void setNewPass()':
keys.ino:124:5: error: 'lcd' was not declared in this scope
menu.ino: In function 'void menuPrincipal()':
menu.ino:16:3: error: 'lcd' was not declared in this scope
menu.ino: In function 'void config()':
menu.ino:74:3: error: 'lcd' was not declared in this scope
menu.ino: In function 'void configQuickGame()':
menu.ino:142:5: error: 'lcd' was not declared in this scope
menu.ino:199:5: error: 'lcd' was not declared in this scope
menu.ino:246:5: error: 'lcd' was not declared in this scope
menu.ino:291:5: error: 'lcd' was not declared in this scope
menu.ino:315:5: error: 'lcd' was not declared in this scope
menu.ino:336:5: error: 'lcd' was not declared in this scope
sabotage.ino: In function 'void sabotage()':
sabotage.ino:31:5: error: 'lcd' was not declared in this scope
sabotage.ino: In function 'void destroySabotage()':
sabotage.ino:130:3: error: 'lcd' was not declared in this scope
searchdestroy.ino: In function 'void search()':
searchdestroy.ino:30:5: error: 'lcd' was not declared in this scope
searchdestroy.ino: In function 'void destroy()':
searchdestroy.ino:115:3: error: 'lcd' was not declared in this scope
searchdestroy.ino: In function 'void endSplash()':
searchdestroy.ino:244:3: error: 'lcd' was not declared in this scope
zutils.ino: In function 'void drawPorcent(byte)':
zutils.ino:4:3: error: 'lcd' was not declared in this scope
zutils.ino: In function 'void cls()':
zutils.ino:53:3: error: 'lcd' was not declared in this scope
zutils.ino: In function 'void printTime(long unsigned int, long unsigned int)':
zutils.ino:63:7: error: 'lcd' was not declared in this scope
zutils.ino:74:5: error: 'lcd' was not declared in this scope
zutils.ino:80:5: error: 'lcd' was not declared in this scope
zutils.ino:83:3: error: 'lcd' was not declared in this scope
zutils.ino:89:5: error: 'lcd' was not declared in this scope
zutils.ino:94:5: error: 'lcd' was not declared in this scope
zutils.ino:96:3: error: 'lcd' was not declared in this scope
zutils.ino: In function 'void printTimeDom(long unsigned int, boolean)':
zutils.ino:117:5: error: 'lcd' was not declared in this scope
zutils.ino:122:5: error: 'lcd' was not declared in this scope
zutils.ino:124:3: error: 'lcd' was not declared in this scope
zutils.ino: In function 'void startGameCount()':
zutils.ino:146:3: error: 'lcd' was not declared in this scope
zutils.ino: In function 'void checkArrows(byte, byte)':
zutils.ino:168:5: error: 'lcd' was not declared in this scope
zutils.ino:172:5: error: 'lcd' was not declared in this scope
zutils.ino:176:5: error: 'lcd' was not declared in this scope
Erreur lors de la compilation.

merci quand meme

Quand tu vas au garage t'amène bien ta voiture pour la faire réparer ? Bin la c'est pareil, si tu mets pas ton code on est pas devins ...

le code et en piece jointe au premier poste depuis le debut !

la je suis carement perdu a croire que ces impossible

Bonjour
:confused:

mecta02:
la je suis carement perdu a croire que ces impossible

Impossible n'est pas Arduino :smiley_cat:

bonjour a toi c se que je me diser impossible pas arduino :slight_smile: mai la ..

Bonjour,
Le programme que tu fournis correspond à ta version avec lcd (16x2).

Pour ton écran UTFT, tu utilises quelle bibliothèque ?

Le problème est relativement simple (version actuelle) :
A partir d'une instance de LiquidCrystal, tu réalises certaines opérations lcd.setCursor, lcd.print, etc....

Pour la version future, tu veux faire la même chose avec un écran UTFT :
Dans ce cas, il faut une instance de UTFT, par exemple glcd. A partir de ce point, il faut transcrire toutes les opérations lcd.setCursor, lcd.print, etc.... avec l'équivalent pour le nouvel écran.

Par contre sans la bibliothèque utilisée, on ne peut pas aller plus loin.
A toi de réagir.
@+

Vu le premier message d'erreur on peut même douter que la librairie soit installée.

j'ai effectivement oublier de déclarer la librairie .....boulettttt

donc jai encore quelque question

a qu'oi doit ressembler le code dans se cas voici un exemple si on peut m’expliquer comment faire sa serai cool !

lcd.clear();
lcd.print("Play Again?");
lcd.setCursor(0,1);
lcd.print("A : Yes B : No");
digitalWrite(REDLED, LOW);
digitalWrite(GREENLED, LOW);
while(1)

et pour sa je fait comment alor étant donner qu'il n’y a plus caractère sur deux lignes ??

void setup(){
lcd.begin(16, 2);
Serial.begin(9600);
// lcd.init(); // initialize the lcd
// lcd.backlight();
lcd.setCursor(3,0);
tone(tonepin,2400,30);
lcd.print("IGNIS ONE");// you can add your team name or someting cool
lcd.setCursor(0,1);
lcd.print(" AIRSOFT SYSTEM");// you can add your team name or someting cool

merci de votre aide

Re,
Sans la bibliothèque pas de salut !!!!!!
Tout ce qui est possible est dans le fichier .h

Tout transcrire vers un autre afficheur est une chose. Modifier le design d'affichage en est une autre. :roll_eyes:

Il y a une documentation de 10 pages avec la librairie UTFT qui détaille toutes les méthodes avec une explication pour chaque argument. Faudrait peut être y jeter un œil.

je ni comprend absolument rien apres comme je diser cest pour rendre service a mon assoc que je fait la demande daide

Oui mais faut comprendre, ici c'est un forum d'entraide ce n'est pas "SOS code pour moi". Donc les demandeurs doivent s'impliquer un minimum. Passer d'un afficheur 16x2 LCD à un afficheur graphique ce n'est pas trivial. D'autant que si tu passes à un afficheur graphique on peut imaginer que tu vas vouloir ajouter des fonctionnalités par rapport au code précédent sinon où serait l’intérêt.

Que donne tes modifications ?

voila le carnage sa signifie koi

Arduino : 1.6.0 (Windows 8), Carte : "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

BombPro.ino: In function 'void setup()':
BombPro.ino:95:10: error: 'class UTFT' has no member named 'setCursor'
BombPro.ino:97:27: error: 'print' was not declared in this scope
BombPro.ino:98:10: error: 'class UTFT' has no member named 'setCursor'
BombPro.ino:99:3: error: 'myGmyGLCD' was not declared in this scope
BombPro.ino:177:20: error: 'createChar' was not declared in this scope
BombPro.ino:178:10: error: 'class UTFT' has no member named 'createChar'
BombPro.ino:179:10: error: 'class UTFT' has no member named 'createChar'
BombPro.ino:180:10: error: 'class UTFT' has no member named 'createChar'
BombPro.ino:181:10: error: 'class UTFT' has no member named 'createChar'
BombPro.ino:182:10: error: 'class UTFT' has no member named 'createChar'
BombPro.ino:183:10: error: 'class UTFT' has no member named 'createChar'
BombPro.ino: In function 'void disarmedSplash()':
BombPro.ino:224:12: error: 'class UTFT' has no member named 'clear'
BombPro.ino:225:12: error: 'class UTFT' has no member named 'setCursor'
BombPro.ino:226:33: error: no matching function for call to 'UTFT::print(const char [14])'
BombPro.ino:226:33: note: candidates are:
In file included from BombPro.ino:2:0:
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:220:8: note: void UTFT::print(char*, int, int, int)
void print(char *st, int x, int y, int deg=0);

^
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:220:8: note: candidate expects 4 arguments, 1 provided
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:221:8: note: void UTFT::print(String, int, int, int)
void print(String st, int x, int y, int deg=0);

^
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:221:8: note: candidate expects 4 arguments, 1 provided
BombPro.ino:227:12: error: 'class UTFT' has no member named 'setCursor'
BombPro.ino:228:29: error: no matching function for call to 'UTFT::print(const char [10])'
BombPro.ino:228:29: note: candidates are:
In file included from BombPro.ino:2:0:
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:220:8: note: void UTFT::print(char*, int, int, int)
void print(char *st, int x, int y, int deg=0);

^
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:220:8: note: candidate expects 4 arguments, 1 provided
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:221:8: note: void UTFT::print(String, int, int, int)
void print(String st, int x, int y, int deg=0);

^
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:221:8: note: candidate expects 4 arguments, 1 provided
BombPro.ino:234:10: error: 'class UTFT' has no member named 'clear'
BombPro.ino:235:29: error: no matching function for call to 'UTFT::print(const char [12])'
BombPro.ino:235:29: note: candidates are:
In file included from BombPro.ino:2:0:
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:220:8: note: void UTFT::print(char*, int, int, int)
void print(char *st, int x, int y, int deg=0);

^
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:220:8: note: candidate expects 4 arguments, 1 provided
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:221:8: note: void UTFT::print(String, int, int, int)
void print(String st, int x, int y, int deg=0);

^
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:221:8: note: candidate expects 4 arguments, 1 provided
BombPro.ino:236:10: error: 'class UTFT' has no member named 'setCursor'
BombPro.ino:237:32: error: no matching function for call to 'UTFT::print(const char [15])'
BombPro.ino:237:32: note: candidates are:
In file included from BombPro.ino:2:0:
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:220:8: note: void UTFT::print(char*, int, int, int)
void print(char *st, int x, int y, int deg=0);

^
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:220:8: note: candidate expects 4 arguments, 1 provided
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:221:8: note: void UTFT::print(String, int, int, int)
void print(String st, int x, int y, int deg=0);

^
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:221:8: note: candidate expects 4 arguments, 1 provided
BombPro.ino: In function 'void explodeSplash()':
BombPro.ino:271:10: error: 'class UTFT' has no member named 'setCursor'
BombPro.ino:272:32: error: no matching function for call to 'UTFT::print(const char [15])'
BombPro.ino:272:32: note: candidates are:
In file included from BombPro.ino:2:0:
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:220:8: note: void UTFT::print(char*, int, int, int)
void print(char *st, int x, int y, int deg=0);

^
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:220:8: note: candidate expects 4 arguments, 1 provided
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:221:8: note: void UTFT::print(String, int, int, int)
void print(String st, int x, int y, int deg=0);

^
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:221:8: note: candidate expects 4 arguments, 1 provided
BombPro.ino:273:10: error: 'class UTFT' has no member named 'setCursor'
BombPro.ino:274:27: error: no matching function for call to 'UTFT::print(const char [10])'
BombPro.ino:274:27: note: candidates are:
In file included from BombPro.ino:2:0:
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:220:8: note: void UTFT::print(char*, int, int, int)
void print(char *st, int x, int y, int deg=0);

^
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:220:8: note: candidate expects 4 arguments, 1 provided
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:221:8: note: void UTFT::print(String, int, int, int)
void print(String st, int x, int y, int deg=0);

^
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:221:8: note: candidate expects 4 arguments, 1 provided
BombPro.ino:288:29: error: no matching function for call to 'UTFT::print(const char [12])'
BombPro.ino:288:29: note: candidates are:
In file included from BombPro.ino:2:0:
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:220:8: note: void UTFT::print(char*, int, int, int)
void print(char *st, int x, int y, int deg=0);

^
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:220:8: note: candidate expects 4 arguments, 1 provided
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:221:8: note: void UTFT::print(String, int, int, int)
void print(String st, int x, int y, int deg=0);

^
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:221:8: note: candidate expects 4 arguments, 1 provided
BombPro.ino:289:10: error: 'class UTFT' has no member named 'setCursor'
BombPro.ino:290:32: error: no matching function for call to 'UTFT::print(const char [15])'
BombPro.ino:290:32: note: candidates are:
In file included from BombPro.ino:2:0:
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:220:8: note: void UTFT::print(char*, int, int, int)
void print(char *st, int x, int y, int deg=0);

^
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:220:8: note: candidate expects 4 arguments, 1 provided
C:\Users\CHIIIIIBI\Documents\Arduino\libraries\UTFT/UTFT.h:221:8: note: void UTFT::print(String, int, int, int)
void print(String st, int x, int y, int deg=0);

Re,
On va faire cours, tu utilises des fonctions qui ne font pas partie de la librairie.
Peut être une erreur de frappe "myGmyGLCD".
Les fonctions autorisées sont décrites dans le fichier .h de la lib ou dans le document mentionné par fdufnews.
@+

bons je pense je v abandonner tempi pour les membres de lassoc ou trouver un mec a payer pour le faire c tou ... merci qand meme

Re,
Oh mon gars, l'abandon n'est pas une solution.
Tu peux le faire mais il faut consulter la doc, elle est là pour cela.
@+