Ted
I had the same problem with a touch pad. The streaking in my case was pen pressure related. I added a "Pen Down" function that would only let the pad draw if the pressure was greater than a preset value. Here is the code in C
Basically energize both plates and read the output from the pad.Code:int PenDwn (void) { OpenADC(ADC_FOSC_64 & ADC_RIGHT_JUST & ADC_8_TAD, ADC_CH0 & ADC_INT_OFF & ADC_REF_VDD_VSS, 11); TS_Y1_Output; //make Y Pins outputs TS_Y2_Output; TS_X1_Input; //make X plates inputs TS_X2_Input; TS_Y1_ON; //energize Y plates TS_Y2_ON; SetChanADC(ADC_CH0); //select voltage channel Delay10TCYx(200); ConvertADC(); //read ACD while( BusyADC()); PenPressure=(1023 & ReadADC())>>2; if (PenPressure > 210) { return (TRUE); //pen pressure exceeded threshold } else { return (FALSE); } }
It worked well for me
Dave




Bookmarks