summaryrefslogtreecommitdiff
path: root/shared-bindings/touchio/TouchIn.c
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2021-03-16 12:21:50 -0500
committerJeff Epler <jepler@gmail.com>2021-03-16 12:21:50 -0500
commit58679dc038e475d7cd00ee45256b7f906ecc2240 (patch)
tree30cbc3f9e7e4efc81a43f364d554f33c1df34169 /shared-bindings/touchio/TouchIn.c
parent97b6664201de2530c9b92957a5e8d2a68524fa7e (diff)
parentbc690d4070c69e21d9070badc9f56a15d62ffb5d (diff)
Merge remote-tracking branch 'origin/main' into bitmap-read-2
Diffstat (limited to 'shared-bindings/touchio/TouchIn.c')
-rw-r--r--shared-bindings/touchio/TouchIn.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/shared-bindings/touchio/TouchIn.c b/shared-bindings/touchio/TouchIn.c
index ff723ccc7..8fb36eab4 100644
--- a/shared-bindings/touchio/TouchIn.c
+++ b/shared-bindings/touchio/TouchIn.c
@@ -59,7 +59,7 @@
//| ...
//|
STATIC mp_obj_t touchio_touchin_make_new(const mp_obj_type_t *type,
- mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
+ mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
// check number of arguments
mp_arg_check_num(n_args, kw_args, 1, 1, false);
@@ -70,7 +70,7 @@ STATIC mp_obj_t touchio_touchin_make_new(const mp_obj_type_t *type,
self->base.type = &touchio_touchin_type;
common_hal_touchio_touchin_construct(self, pin);
- return (mp_obj_t) self;
+ return (mp_obj_t)self;
}
//| def deinit(self) -> None:
@@ -144,7 +144,7 @@ const mp_obj_property_t touchio_touchin_raw_value_obj = {
.proxy = {(mp_obj_t)&touchio_touchin_get_raw_value_obj,
(mp_obj_t)&mp_const_none_obj,
(mp_obj_t)&mp_const_none_obj},
- };
+};
//| threshold: Optional[int]
@@ -153,7 +153,13 @@ const mp_obj_property_t touchio_touchin_raw_value_obj = {
//| When the **TouchIn** object is created, an initial `raw_value` is read from the pin,
//| and then `threshold` is set to be 100 + that value.
//|
-//| You can adjust `threshold` to make the pin more or less sensitive."""
+//| You can adjust `threshold` to make the pin more or less sensitive::
+//|
+//| import board
+//| import touchio
+//|
+//| touch = touchio.TouchIn(board.A1)
+//| touch.threshold = 7300"""
//|
STATIC mp_obj_t touchio_touchin_obj_get_threshold(mp_obj_t self_in) {
touchio_touchin_obj_t *self = MP_OBJ_TO_PTR(self_in);