incorrect touch coordinates Rpi + adafruit resistive touch 320x240

29 views
Skip to first unread message

Deadparrot

unread,
Jun 26, 2018, 1:27:16 PM6/26/18
to Kivy users support
OS: Raspbian 9 (stretch)
python: 3.5.3
kivy: V1.11.0.dev0
OpenGL: ES 2.0

I have a 320x240 display, using it in landscape mode. In my configuration file I have the following:

[input]
mouse = mouse
%(name)s = probesysfs,provider=hidinput
pitft = mtdev,/dev/input/touchscreen,max_position_x=320,max_position_y=240,invert_y=0,invert_x=0,rotation=0

Touchtracer reports 
touch.x=542.00, touch.y=420.80. when I press on the bottom left.
touch.x = 67.36, touch.y= 48.05 when I touch top right.

Now I have two buttons in my application one at the bottom left and one at the bottom right.

The one on the bottom right works fine.
The one on the bottom left doesn't, unless I press on the top right of the screen.

I've messed aroud with the config file but I'm puzzled by this behaviour and not getting very far.

How can I fix this?

thanks











Nigel Brown

unread,
Jun 27, 2018, 2:57:15 AM6/27/18
to Kivy users support
Have you tried:

param=max_position_x=320, param=max_position_y=240

Deadparrot

unread,
Jun 27, 2018, 6:00:24 AM6/27/18
to Kivy users support
Thank you for your reply Nigel.

When I try "param=max_position_x=320, param=max_position_y=240" in the config file I get the following.

So this gives us more clues, in that the range for X and Y are reported as 4096. The same is reported when I revert back to my original config file.
So question is, where does kivy get the 4096 values from?



[INFO   ] [HIDInput    ] Read event from </dev/input/event0>
[INFO   ] [MTD         ] Read event from </dev/input/touchscreen>
[ERROR  ] [MTD         ] Bad parameter ['param', 'max_position_x', '320']: Not in key=value format
[ERROR  ] [MTD         ] Bad parameter ['param', 'max_position_y', '240']: Not in key=value format
[INFO   ] [MTD         ] Set custom invert_y to 0
[INFO   ] [MTD         ] Set custom invert_x to 0
[INFO   ] [MTD         ] Set custom rotation to 0
[INFO   ] [Base        ] Start application main loop
[INFO   ] [HIDMotionEvent] using <b'stmpe-ts\x00                                                                                                                                                                                                                                                       '>
[INFO   ] [HIDMotionEvent] <b'stmpe-ts\x00                                                                                                                                                                                                                                                       '> range ABS X position is 0 - 4095
[INFO   ] [MTD         ] </dev/input/touchscreen> range position X is 0 - 4095
[INFO   ] [HIDMotionEvent] <b'stmpe-ts\x00                                                                                                                                                                                                                                                       '> range ABS Y position is 0 - 4095
[INFO   ] [MTD         ] </dev/input/touchscreen> range position Y is 0 - 4095
[INFO   ] [HIDMotionEvent] <b'stmpe-ts\x00                                                                                                                                                                                                                                                       '> range ABS pressure is 0 - 255
[INFO   ] [MTD         ] </dev/input/touchscreen> range touch major is 0 - 0
[INFO   ] [MTD         ] </dev/input/touchscreen> range touch minor is 0 - 0
[INFO   ] [MTD         ] </dev/input/touchscreen> range pressure is 0 - 255
[INFO   ] [MTD         ] </dev/input/touchscreen> axes invertion: X is 0, Y is 0
[INFO   ] [MTD         ] </dev/input/touchscreen> rotation set to 0

Reply all
Reply to author
Forward
0 new messages