Hi
I want to read the touch coordinates (x,y) from a picaso scg display.
Datasheet: http://www.4dsystems.com.au/downloads/S ... -rev10.pdf
I send the following hex commands(via UART) to the display to read those coordinates:
0x6F //command
0x4F //get touch status
0x6F //command
0x5F //get touch coordinates
0x5F returns a 2 byte value for x and a 2 byte value for y.
How can i place this return value in a string to place it as text on the display ?
Thanks in advance.
Read coordinates touchscreen(UART)
Re: Read coordinates touchscreen(UART)
Have you tried inttostr() found in help file?
Re: Read coordinates touchscreen(UART)
I have made the following code but i can't still read the coordinates on the screen:
main code:
Code: Select all
void interrupt () {
if (PIR1.RCIF) { // test the interrupt for uart rx
rxchar = Uart1_Read(); //
rxarray[i] = rxchar;
PORTB=0b000011000;
i++;
// ******************************************************
// Only select one of the following statements
if (i ==0) { // select this if looking for a number of characters
flag = 1;
PORTB=0b00001000;
} // end if (rxchar == "$")
}
// end if (PIR1.RCIF)
}
main code:
Code: Select all
void main() {
unsigned short j;
INTCON.GIE = 1; // Enable global interrupts
INTCON.PEIE = 1;
PIE1.RCIE = 1;
while(1) {
Initpic(); //configuratie pic
InitScreen();
DelayOneCode(100);
Uart1_write(0x6F);
UART1_write(0x04);
UART1_write(0x6F);
UART1_write(0x05);
if (flag ==1) {
j = 0;
while(j < i) {
WriteText(rxarray[j],0,0);
j++;
}
i = 0;
flag = 0;
}
}
}