Touch Interface Configuration

Current Status
The MSP4030 touchscreen is working, but the coordinate mapping is not yet perfectly aligned with the on-screen buttons.

What’s working :white_check_mark:

:white_check_mark: Touch detection (the FT6336 communicates correctly over I2C)
:white_check_mark: Reading raw coordinates (rawX, rawY)
:white_check_mark: Display of the graphical interface
:white_check_mark: Sugarboat BLE (connection, data)

What needs adjustment :wrench:

:wrench: Touch mapping: Touch coordinates must be correctly converted to match the on-screen buttons.

:bullseye: Calibration process
To calibrate the screen, I need you to touch the center of each button and send me the coordinates shown in the Serial Monitor.

Instructions:
Touch the three buttons at the bottom of the main screen, one after the other:

  • CONNECT (blue button on the left)
  • CONFIG (purple button in the center)
  • LOG SD (green button on the right)

For each button, copy and paste these two lines:

Touch RAW: X=... Y=...
Touch MAPPED: X=... Y=...

Example of what I’m looking for:

CONNECT button:
Touch RAW: X=28 Y=150
Touch MAPPED: X=75 Y=275

CONFIG button:
Touch RAW: X=28 Y=280
Touch MAPPED: X=240 Y=275

LOG SD button:
Touch RAW: X=41 Y=435
Touch MAPPED: X=390 Y=275

:abacus: Why these coordinates?
The touchscreen reports coordinates in its own system (0–319 for X, 14–478 for Y), while the display uses a different system (0–480 for X, 0–320 for Y). I need to calculate the exact conversion formula between the two.

The buttons are located at the following positions on the screen:

  • CONNECT: X=20–160, Y=250–300 (center ≈ X=90, Y=275)
  • CONFIG: X=170–310, Y=250–300 (center ≈ X=240, Y=275)
  • LOG SD: X=320–460, Y=250–300 (center ≈ X=390, Y=275)

The following link may be helpful:

I've tried it before and was pleased with the results.

It looks like you are using AI to help you.
Can't you just print two dots on the screen, diagonally opposite each other, near the corners, something like this:

Top Left TFT X = 25
Top Left TFT Y = 25

Bottom Right TFT X = 295
Bottom Right TFT Y = 215

and then, for each of those values, state what the touch screen returns when you press on the calibration point.

Once you do this, you (or the AI bot) should be able to write 2 functions which, when given a touch screen coordinate, returns the equivalent (TFT) screen coordinate.

float convTouchToScrnY(uint16_t touchY) ;
float convTouchToScrnX(uint16_t touchX) ;

I do something like this for a similar calibration activity :