0

3.2" TFT Touchscreen Pressure Noise Problem
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

3.2" TFT Touchscreen Pressure Noise Problem

by dslocum on Sat Jan 12, 2019 1:41 pm

Hi guys,

I'm not new to programming but I am new to Arduinos & STM type stuff - mostly a PIC guy.

I just got one of the 3.2" TFT w/Touchscreen and trying to run the sample code "breakouttouchpaint" on a generic Blue Pill board. The graphics and X / Y touch are reading OK after fiddling around a little (set NUMSAMPLES = 8), but I had to disable (comment) the "return" statement in the main loop:
Code: Select all | TOGGLE FULL SIZE
  if (p.z < MINPRESSURE || p.z > MAXPRESSURE) {
     //return;
  }


When I look at Pressure variable, without being pressed, I get wild numbers - all over the place:
Code: Select all | TOGGLE FULL SIZE
Pressure = -30585
   Pressure = 19685
   Pressure = -30642
   Pressure = 2302
   Pressure = 1209
   Pressure = 19744
   Pressure = 19444
   Pressure = -17433
   Pressure = -30867
   Pressure = -30810
   Pressure = -30754
   Pressure = 19744
   Pressure = -30698
   Pressure = 5193


And when I touch the screen I get numbers going from about 300 to -7000 (or so). I can't figure out if it's some variable out of range, or a #define that's not set because I'm using the Blue Pill. I would think there would be a much smaller range of noise than that. :-/

BTW, how should the Blue Pill be #defined ?

I'll provide code if someone can suggest what sections I need to post.

Thanks

dslocum
 
Posts: 3
Joined: Fri Oct 21, 2016 12:09 pm

Please be positive and constructive with your questions and comments.