Comments (6)
@gmgunderground Have you tried adjusting data? If it always shifts toward the center, I think you can compensate by changing the calibration value closer to the center. For example, try the following .
uint16_t data[8]; data[0] = 32; // left top X data[1] = 32; // left top Y data[2] = 32; // left bottom X data[3] = 207; // left bottom Y data[4] = 287; // right top X data[5] = 32; // right top Y data[6] = 287; // right bottom X data[7] = 207; // right bottom Y M5.Display.setTouchCalibrate(data);
BTW, there is an update to the Core2 touch panel firmware. This reduces the problem of coordinates being shifted vertically at the top of the screen. ( It may have already been updated if your purchase was recent. )
Try to write
Core2_Tools
once usingM5Burner
. If the touch panel firmware is out of date,Core2_Tools
will perform the update at startup.Once the firmware update is performed, it will remain effective even if other programs are written thereafter.
I installed M5 Tools and it updated the display firmware at startup. Now the touch screen seems to be doing much better.
Thank you
from m5unified.
Now all it's ok
from m5unified.
Hello @gmgunderground .
Do you mean that you shift slightly toward the center of the screen from the touched position?
If so, the following code will allow some adjustment.
#include <M5Unified.h>
void setup(void)
{
M5.begin();
uint16_t data[8];
/// Calibrate by touching the four corners of the screen in sequence.
M5.Display.calibrateTouch(data, TFT_WHITE, TFT_BLACK, 32);
/// The data array contains the coordinate values of the four corners.
Serial.print("calibrate data:\n");
for (int i = 0 ; i < 8; ++i)
{
Serial.printf("[%d] = %d\n", i, data[i]);
}
/// Or, directly specify the coordinate values of the four corners without touching the screen.
/// If the value is set a little closer to the center, the touch coordinates will be a little outward.
/*
data[0] = 8; // left top X
data[1] = 8; // left top Y
data[2] = 8; // left bottom X
data[3] = 223; // left bottom Y
data[4] = 303; // right top X
data[5] = 8; // right top Y
data[6] = 303; // right bottom X
data[7] = 223; // right bottom Y
*/
/// set calibrate data:
M5.Display.setTouchCalibrate(data);
}
void loop(void)
{
m5gfx::touch_point_t tp[5];
auto tc = M5.Display.getTouch(tp, 5);
if (tc)
{
M5.Display.fillScreen(0);
for (int i = 0; i < tc; ++i)
{
M5.Display.drawCircle(tp[i].x, tp[i].y, 64, rand());
M5.Display.drawFastHLine(0, tp[i].y, M5.Display.width(), rand());
M5.Display.drawFastVLine(tp[i].x, 0, M5.Display.height(), rand());
}
}
}
from m5unified.
@lovyan03 Thanks for the code, it actually helps a bit to improve the touch behavior, but it still remains quite inaccurate. Especially in the corners, the measured values of X and Y are quite wrong, significantly improving towards the center of the screen
from m5unified.
@gmgunderground
Have you tried adjusting data?
If it always shifts toward the center, I think you can compensate by changing the calibration value closer to the center.
For example, try the following .
uint16_t data[8];
data[0] = 32; // left top X
data[1] = 32; // left top Y
data[2] = 32; // left bottom X
data[3] = 207; // left bottom Y
data[4] = 287; // right top X
data[5] = 32; // right top Y
data[6] = 287; // right bottom X
data[7] = 207; // right bottom Y
M5.Display.setTouchCalibrate(data);
BTW, there is an update to the Core2 touch panel firmware.
This reduces the problem of coordinates being shifted vertically at the top of the screen.
( It may have already been updated if your purchase was recent. )
Try to write Core2_Tools
once using M5Burner
.
If the touch panel firmware is out of date, Core2_Tools
will perform the update at startup.
Once the firmware update is performed, it will remain effective even if other programs are written thereafter.
from m5unified.
@gmgunderground
Congratulations on the improvement of the touch panel performance issue !
Am I correct in assuming that this Issue has been resolved?
from m5unified.
Related Issues (20)
- Cracking sound on speaker using the "M5CoreS3-Esphome/voice-assistant" HOT 2
- M5Core2 Power LED HOT 8
- Customised buttons HOT 1
- M5Capsule cannot be detected corretly HOT 2
- Setting text color on LCD prevents breaks text output HOT 1
- M5Stamp C3でM5Unifiedをincludeできない HOT 2
- build error with esp-idf 5.1.1 for esp32-c3 HOT 2
- Example "Display_Unicode" doesn't compile with M5Unified HOT 6
- can't ring the speaker of M5Stack CoreS3 with esp-idf HOT 5
- Unit Mini OLED display does not work with M5Stamp-Pico HOT 3
- S3 family compilation error: unused variable when compiler_warnings=all HOT 1
- H/W infomationにS3系新機種がない HOT 1
- AXP2101_Class.cpp not fully implemented HOT 2
- AtomS3 Button not defined in M5Unified.h HOT 4
- M5unified and boot/flash encryption HOT 2
- IDF 5.1/Arduino 3.0 support: legacy adc driver migration missing causing a boot crash if an ADC input is used HOT 3
- IDF 5.1/Arduino 3.0 support: M5.Speaker methods, camera input broken (CoreS3)
- M5Paper wakes too soon from deep sleep when touch wakeup is enabled - with solution HOT 2
- Minimalist configuration using M5Unified and BluetoothA2DPSink HOT 3
- M5CoreS3 speaker issue HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from m5unified.