and TFT_Write_Text I get a compile error saying: Too many actual parameters.
What does this mean and how do I solve it. Here is my code:
Code: Select all
char *text = "electronics";
char test2[2] = "7";
// TFT module connections
char TFT_DataPort at LATE;
char TFT_DataPort_Direction at TRISE;
sbit TFT_RST at LATC1_bit;
sbit TFT_BLED at LATD2_bit;
sbit TFT_RS at LATB15_bit;
sbit TFT_CS at LATF12_bit;
sbit TFT_RD at LATD5_bit;
sbit TFT_WR at LATD4_bit;
sbit TFT_RST_Direction at TRISC1_bit;
sbit TFT_BLED_Direction at TRISD2_bit;
sbit TFT_RS_Direction at TRISB15_bit;
sbit TFT_CS_Direction at TRISF12_bit;
sbit TFT_RD_Direction at TRISD5_bit;
sbit TFT_WR_Direction at TRISD4_bit;
// End Glcd module connections
// Touch Panel module connections
sbit DriveX_Left at LATB13_bit;
sbit DriveX_Right at LATB11_bit;
sbit DriveY_Up at LATB12_bit;
sbit DriveY_Down at LATB10_bit;
sbit DriveX_Left_Direction at TRISB13_bit;
sbit DriveX_Right_Direction at TRISB11_bit;
sbit DriveY_Up_Direction at TRISB12_bit;
sbit DriveY_Down_Direction at TRISB10_bit;
// End Touch Panel module connections
// Global variables
unsigned int Xcoord, Ycoord;
char PenDown;
void *PressedObject;
int PressedObjectType;
unsigned int caption_length, caption_height;
unsigned int display_width, display_height;
// Example of establishing 16-bit communication between TFT display and PORTD, PORTE of MCU :
void PMPWaitBusy() {
while(PMMODEbits.BUSY);
}
void SetIndex(unsigned short index) {
TFT_RS = 0;
PMDIN = index;
PMPWaitBusy();
}
void WriteCommand( unsigned short cmd ) {
TFT_RS = 1;
PMDIN = cmd;
PMPWaitBusy();
}
void WriteData(unsigned int _data) {
TFT_RS = 1;
PMDIN = _data;
PMPWaitBusy();
}
static void InitializeTouchPanel() {
AD1PCFG = 0xFFFF;
PCFG12_bit = 0;
PCFG13_bit = 0;
// PMP setup
PMMODE = 0;
PMAEN = 0;
PMCON = 0; // WRSP: Write Strobe Polarity bit
PMMODEbits.MODE = 2; // Master 2
PMMODEbits.WAITB = 0;
PMMODEbits.WAITM = 1;
PMMODEbits.WAITE = 0;
PMMODEbits.MODE16 = 1; // 16 bit mode
PMCONbits.CSF = 0;
PMCONbits.PTRDEN = 1;
PMCONbits.PTWREN = 1;
PMCONbits.PMPEN = 1;
ADC1_Init();
TFT_Set_Active(SetIndex,WriteCommand,WriteData);
TFT_Init(320, 240);
TP_TFT_Init(320, 240, 13, 12); // Initialize touch panel
TP_TFT_Set_ADC_Threshold(1000); // Set touch panel ADC threshold
PenDown = 0;
PressedObject = 0;
PressedObjectType = -1;
}
void main() {
TRISE = 0;
TRISD = 0;
//TFT_Set_Active(Set_Index,Write_Command,Write_Data);
TFT_Init(320, 240);
InitializeTouchPanel();
// You can get calibration constants using touch panel calibration example
TP_TFT_Set_Calibration_Consts(76, 907, 77, 915); // Set calibration constants
TFT_Fill_Screen(CL_WHITE);
TFT_Set_Font(TFT_defaultFont, CL_BLACK, FO_HORIZONTAL);
TFT_Set_Brush(0, 0, 1, LEFT_TO_RIGHT, CL_BLACK, CL_WHITE);
TFT_Rectangle(20, 20, 219, 107);
TFT_Circle(120, 64, 110);
TFT_Write_Text("test", 4, 4,); //<<<<<<<<<<<<<<<<<<<<<<<<<<<< compiler complains here
// TFT_Write_Char('A',22,23,);
while(1)
{
}
}
Also I wonder if anyone knows a easy way to get the name of all the files from a FAT16 SD card using the Multi Media Card Library