diff --git a/config.h b/config.h index 118cc98..6cb5b06 100644 --- a/config.h +++ b/config.h @@ -7,18 +7,18 @@ public: }; const uint8_t MPR_PADNUMS[] = {12, 12, 12, 12}; -const uint8_t THREASHOLD = 35; +const uint8_t THREASHOLD = 32; touchblock touchmap[34] = { // Group A - {3, 4, 0}, // 1 - {3, 0, 0}, // 2 - {2, 4, 0}, // 3 - {2, 0, 0}, // 4 - {1, 5, 0}, // 5 - {1, 0, 0}, // 6 - {0, 4, 0}, // 7 - {0, 0, 0}, // 8 + {3, 4, -3}, // 1 + {3, 0, -3}, // 2 + {2, 4, -3}, // 3 + {2, 0, -3}, // 4 + {1, 5, -3}, // 5 + {1, 0, -3}, // 6 + {0, 4, -3}, // 7 + {0, 0, -3}, // 8 // Group B {3, 5, 0}, // 1 {3, 1, 0}, // 2 @@ -72,6 +72,16 @@ const uint8_t RELEASE_THREASHOLD_OFFSET = 0; // NHDF = 1 // NCLF = 16 // FDLF = 4 +// if some regions get stuck easily, you can try the following values +// to make the system more sensitive to environmental changes +// MHDR = 2; +// NHDR = 2; +// NCLR = 4; +// FDLR = 0; +// MHDF = 4; +// NHDF = 2; +// NCLF = 16; +// FDLF = 2; // rising NHD is larger than falling NHD because rising is the release direction // the rising changes are more likely to be environmental changes // rising NCL being smaller than falling NCL is because of the same reason @@ -125,7 +135,7 @@ const uint8_t ELECTRODE_SAMPLE_INTERVAL = 0; // this smoothes out the signal and prevents false release // however, a debounce value that's too high might cause releases that are too short to be missed // if the user notices too many false releases, try to increase this value. but don't set it too high -const uint8_t RELEASE_DEBOUNCE = 1; +const uint8_t RELEASE_DEBOUNCE = 0; // range: 0 - 7 // when DT + 1 samples are higher than the threshold, the electrode is touched diff --git a/maimaiTouchControl.ino b/maimaiTouchControl.ino index 168e28b..25dbba6 100644 --- a/maimaiTouchControl.ino +++ b/maimaiTouchControl.ino @@ -30,7 +30,7 @@ void setup() mpr[1].begin(0x5B, &Wire); mpr[2].begin(0x5C, &Wire); mpr[3].begin(0x5D, &Wire); - Wire.setClock(400000); + Wire.setClock(100000); // config conversion