Touchscreen Edge Detection

I dont know what to do with it.

I touched left, right, top and bottom of the screen and put theese values into TS_LEFT, TS_RIGHT etc.
Then I used that map function. Im having different reads now but still not what I expected. I have setRoataion(1) (Landscape) maybe that has something to do with it.

You said "don't guess - know"

But you have to understand that I wrote my first code lines a week ago, and the touchscreen is just a byproduct of my schoolproject. But it needs to work. Thats why im kinda stressed out atm and used forum to hopefully get a quick guide on what I need to do to get it working. But looks like its much more complicated than I initially tought.