Ishraq Ibne Ashraf
and 1 contributors

NAME

Tinkerforge::BrickletMotionDetector - Passive infrared (PIR) motion sensor, 7m range

CONSTANTS

DEVICE_IDENTIFIER

This constant is used to identify a Motion Detector Bricklet.

The get_identity() subroutine and the CALLBACK_ENUMERATE callback of the IP Connection have a device_identifier parameter to specify the Brick's or Bricklet's type.

DEVICE_DISPLAY_NAME

This constant represents the display name of a Motion Detector Bricklet.

CALLBACK_MOTION_DETECTED

This constant is used with the register_callback() subroutine to specify the CALLBACK_MOTION_DETECTED callback.

CALLBACK_DETECTION_CYCLE_ENDED

This constant is used with the register_callback() subroutine to specify the CALLBACK_DETECTION_CYCLE_ENDED callback.

FUNCTION_GET_MOTION_DETECTED

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_SET_STATUS_LED_CONFIG

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_STATUS_LED_CONFIG

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_IDENTITY

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTIONS

new()

Creates an object with the unique device ID *uid* and adds it to the IP Connection *ipcon*.

get_motion_detected()

Returns 1 if a motion was detected. How long this returns 1 after a motion was detected can be adjusted with one of the small potentiometers on the Motion Detector Bricklet, see :ref:`here <motion_detector_bricklet_sensitivity_delay_block_time>`.

There is also a blue LED on the Bricklet that is on as long as the Bricklet is in the "motion detected" state.

set_status_led_config()

Sets the status led configuration.

By default the status LED turns on if a motion is detected and off is no motion is detected.

You can also turn the LED permanently on/off.

.. versionadded:: 2.0.1$nbsp;(Plugin)

get_status_led_config()

Returns the configuration as set by :func:`Set Status LED Config`.

.. versionadded:: 2.0.1$nbsp;(Plugin)

get_identity()

Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier.

The position can be 'a', 'b', 'c' or 'd'.

The device identifier numbers can be found :ref:`here <device_identifier>`. |device_identifier_constant|