ft6336: add support for ft6336

This commit is contained in:
sago35
2021-12-14 22:29:33 +09:00
committed by Ron Evans
parent 025a66655f
commit 45c68ef0fc
8 changed files with 422 additions and 2 deletions
+16
View File
@@ -0,0 +1,16 @@
package main
func main() {
touchScreen, _ := initDevices()
for {
touch := touchScreen.ReadTouchPoint()
if touch.Z > 0 {
//X and Y are 16 bit with 12 bit resolution and need to be scaled for the display size
//Z is 24 bit and is typically > 2000 for a touch
println("touch:", touch.X, touch.Y, touch.Z)
//Example of scaling for m5stack-core2's 320x240 display with 320x270 touch area
println("screen:", (touch.X*320)>>16, (touch.Y*270)>>16)
}
}
}