From 61e33fac362ec2710235a454afa4624c134c9ed3 Mon Sep 17 00:00:00 2001 From: xyqyear Date: Sun, 16 Jul 2023 08:35:56 +0800 Subject: [PATCH] add explaination to baseline tracking parameters --- maimaiTouchControl.ino | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/maimaiTouchControl.ino b/maimaiTouchControl.ino index b6b0955..4295526 100644 --- a/maimaiTouchControl.ino +++ b/maimaiTouchControl.ino @@ -82,6 +82,15 @@ void MprSetup(Adafruit_MPR121 cap) cap.writeRegister(MPR121_ECR, 0x0); // @AN3891 + // those values controls the baseline tracking to environment changes + // suffix R and F means rising and falling + // falling is the touch direction, rising is the release direction + // MHD is the max half delta, the max difference between the baseline and the data + // if the difference is larger than this value, the baseline will be updated (NCL and FDL conditions must also be met) + // NCL is the noise count limit, at least this many of changes must be larger than MHD to trigger a baseline update + // FDL is the filter delay count limit, the baseline will be updated after this many samples + // if a touch is detected mid way, the update is cancelled + // NHD is the noise half delta, the baseline will be changed this much when the above conditions are met cap.writeRegister(MPR121_MHDR, MHDR); cap.writeRegister(MPR121_NHDR, NHDR); cap.writeRegister(MPR121_NCLR, NCLR);