1 parent 539aaf0 commit 294b026Copy full SHA for 294b026
1 file changed
ports/nrf/common-hal/touchio/TouchIn.c
@@ -77,6 +77,8 @@ void common_hal_touchio_touchin_construct(touchio_touchin_obj_t* self,
77
const mcu_pin_obj_t *pin) {
78
self->pin = pin;
79
claim_pin(pin);
80
+
81
+ self->threshold = get_raw_reading(self) * 1.05 + 100;
82
}
83
84
bool common_hal_touchio_touchin_deinited(touchio_touchin_obj_t* self) {
@@ -108,6 +110,7 @@ uint16_t common_hal_touchio_touchin_get_threshold(touchio_touchin_obj_t *self) {
108
110
return self->threshold;
109
111
112
-void common_hal_touchio_touchin_set_threshold(touchio_touchin_obj_t *self, uint16_t new_threshold) {
113
+void common_hal_touchio_touchin_set_threshold(touchio_touchin_obj_t *self,
114
+ uint16_t new_threshold) {
115
self->threshold = new_threshold;
116
0 commit comments