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.
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.
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
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.
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 " !!!
*****************************************
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.
Bookmarks