• Espruino code uses 160x160 from digging around, mb thats a close estimate of what you should be using?
    LCD_WIDTH / 160
    LCD_HEIGHT / 160
    So these values would be your 'unit chunks' for touch grid size. So its like 0-160, is multiplies that number by LCD_HEIGHT/160 to get the amount in 'pixels', and it stores as int, so its naturally math.floor rounded down to its integer.

    But the main bottleneck concern, surely is whether your fat finger can touch that little pixels? The minimum size should be what your finger can hit and its location will not matter because the unitSize is small enough in relation to the 'fingerSize' that it won't matter.

  • Very good to know. Through experimentation, I've found that touch works OK if I clip it manually to be within 0..176. It's necessary to tap the center of the buttons, and difficult to distinguish anything much smaller than my buttons, but it works. If I get annoyed, maybe I'll try 160x160.

  • 176 / 160 = 1.1 exactly.
    So every 1.1 units of LCD display, is roughly 1 touch pixel. The touch callback is returning LCD pixels, not touch pixels because it wants to abstract that away, its mostly irrelevant.

    the callback fires, converts the touch pixel into LCD pixels, and gives you that, so you can work with LCD pixels without converting.


Avatar for user141569 @user141569 started