Go Down

Topic: problem [ not maching function for call to 'UTFT::UTFT(int,int,int,int) ] (Read 677 times) previous topic - next topic

TTU.ABD

I bought from website [ http://www.sainsmart.com/arduino-compatibles/sainsmart-kit-1/sainsmart-mega2560-board-3-5-tft-lcd-module-display-shield-kit-for-atmel-atmega-avr-16au-atmega8u2.html ]
I I download utft library then moved to folder ((arduino 0023\libraries)) then I wrote Demo code :

#include <UTFT.h>
UTFT    myGLCD(ITDB32S,38,39,40,41);
void setup()
{
  myGLCD.InitLCD(PORTRAIT);
  drawdisplay();
}
void drawDisplay()
{  // Clear screen
myGLCD.clrScr();
// print the lines
myGLCD.setColor(0,255,0);
myGLCD.setBackColor(255,255,255);
MYGLCD.drawRect(0,0,239,319);
myGLCD.drawLine(0,50.5,239,50.5);
myGLCD.drawLine(0,100,239,100);
myGLCD.drawLine(0,130,239,130);
for(int y=1;y<6;y++)
{ myGLCD.drawLine(39.83333333333*y,100,39.83333333333*y,130); }
myGLCD.drawRect(190,50.5,239,76)
myGLCD.drawLine(0,182,319,182);
myGLCD.drawLine(0,208,239,208);
myGLCD.drawLine(0,289,239,289);
myGLCD.drawLine(30,208,30,289);
myGLCD.drawLine(209,208,209,289);
myGLCD.drawLine(119.5,130,119.5,208); // the center
myGLCD.drawCircle(197.3488,70.634,2.8488);}
void loop()
{}



but show error msg [ not maching function for call to 'UTFT::UTFT(int,int,int,int) ]
what's the problem ?

HazardsMind

Quote
myGLCD.drawLine(39.83333333333*y,100,39.83333333333*y,130);
myGLCD.drawLine(119.5,130,119.5,208); // the center
myGLCD.drawCircle(197.3488,70.634,2.8488);

These can not be floats, only ints 39, 119, 197.
My GitHub:
https://github.com/AndrewMascolo?tab=repositories

johnwasser

From the error message it looks like the UTFT constructor is being called with four integers (and failing because there is no constructor that takes four integers).  But in your code the constructor is called with five values (the last four being integers):
Code: [Select]
UTFT    myGLCD(ITDB32S,38,39,40,41);

I don't know what is causing that but I would double-check the constructor documentation to make sure you are passing the right arguments in the right order.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Go Up