Skip to content

Commit a7f5cbb

Browse files
committed
Merge branch 'fix-505' of https://github.com/delciotorres/python-gpiozero into delciotorres-fix-505
2 parents a4db920 + bdb3f9d commit a7f5cbb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

gpiozero/input_devices.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,15 +423,19 @@ class MotionSensor(SmoothedInputDevice):
423423
filled with values. Only set this to ``True`` if you require values
424424
immediately after object construction.
425425
426+
:param bool pull_up:
427+
If ``False`` (the default), the GPIO pin will be pulled low by default.
428+
If ``True``, the GPIO pin will be pulled high by the sensor.
429+
426430
:param Factory pin_factory:
427431
See :doc:`api_pins` for more information (this is an advanced feature
428432
which most users can ignore).
429433
"""
430434
def __init__(
431435
self, pin=None, queue_len=1, sample_rate=10, threshold=0.5,
432-
partial=False, pin_factory=None):
436+
partial=False, pull_up=False, pin_factory=None):
433437
super(MotionSensor, self).__init__(
434-
pin, pull_up=False, threshold=threshold,
438+
pin, pull_up=pull_up, threshold=threshold,
435439
queue_len=queue_len, sample_wait=1 / sample_rate, partial=partial,
436440
pin_factory=pin_factory
437441
)

0 commit comments

Comments
 (0)