Touchscreen question


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    May 2008
    Location
    Florida
    Posts
    64

    Default Touchscreen question

    I am playing with the Touchscreen and gLCD on the EasyPIC5 and I am getting extra pixels lighting up on the screen when I draw something. They always appear at least an inch below where I have drawn a line.
    I was wondering what was causing this, the code is in MikroBasic or I would post it here.

    Anyway my question is what would be a good delay for debouncing the drivers? They are currently using delay_ms(2). I am assuming that is what is causing them to appear because they only appear when I lift the pen from the screen.

    Any suggestions or other comments. I am going to start porting over to PBP next.

  2. #2
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    Try something like
    for k = 2 to (some higher number)
    delay_ms(k)
    next k

    and print the current delay on the screen.

    Should do the trick.

  3. #3
    Join Date
    Mar 2008
    Location
    Gerogetown, Texas
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    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
    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);
    			}
    }
    Basically energize both plates and read the output from the pad.

    It worked well for me

    Dave

  4. #4
    Join Date
    May 2008
    Location
    Florida
    Posts
    64


    Did you find this post helpful? Yes | No

    Default

    Think I might have found the answer digging around the MikroE Forums. Possible is floating ADC pins. I have the pullups disconnected as per the manual. I am going to put them back on the ADC pins and see what happens.

    DaveC3 -Thanks for the suggestion, but they have something like penDown already in the code and I have played with the value with no luck. Going to rest my eyes tonight and try again tomorrow.

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Hi, manwolf,

    I think the MKE Touchscreen is a bit "lazy" ... and some quick pen writings cause some surprising pixels ... due to the measuring way.

    But I do not remember we were on a MkE nor C Forum, here ...

    Why not ask this on the dedicated forum ??? surely more answers !

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by DaveC3 View Post
    Ted
    It is manwolf asking not me.

    manwolf, as you were not referring to me did you understand my answer?

  7. #7
    Join Date
    May 2008
    Location
    Florida
    Posts
    64


    Did you find this post helpful? Yes | No

    Default

    Huh?? what? when? where? How?

    This is very confusing because my name is Ted also, so here I go.

    Ted's - tried a wide range of values with no luck, however didn't have to change much for the screen to quit responding alltogether.

    DAVE3C- Pendown type check already in the code. Played with the value up and down. caused a minor change bit still throwing extra pixels. Always about an inch below the pin x,y.

    Acertronics - Thanks I have been digging around, that is where I came across the post for the floating ADC pins. Had invite to dinner so I haven't had a chance to test it out yet.

Similar Threads

  1. AN Question for "word" variable read The serial port
    By redfoen in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 14th December 2007, 17:39
  2. FREQOUT - PWM question
    By Etcho in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 25th February 2007, 23:51
  3. PIC16F684 Program question
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th December 2006, 14:30
  4. Question for a math guru
    By Christopher4187 in forum General
    Replies: 3
    Last Post: - 22nd November 2006, 09:45
  5. Please answer my first question
    By John_001 in forum Off Topic
    Replies: 1
    Last Post: - 15th September 2006, 06:49

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts