Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions adafruit_vc0706.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,12 @@ def get_motion_detect(self):
"""Query the gesture detection status"""
return self._run_command(_COMM_MOTION_STATUS, bytes([0x00]), 6)

def set_motion_detect(self, args):
def set_motion_detect(self, enabled):
"""Set gesture detection status.
args = 0 to unset, 1 to set

:param bool enabled: False to disable motion detected, True to enable motion detection.
"""
return self._run_command(_COMM_MOTION_CTRL, bytes([0x01, args]), 5)
return self._run_command(_COMM_MOTION_CTRL, bytes([0x01, enabled]), 5)

def _run_command(self, cmd, args, resplen, flush=True):
if flush:
Expand Down