Ishraq Ibne Ashraf

NAME

Tinkerforge::BrickletTilt - Detects inclination of Bricklet (tilt switch open/closed)

CONSTANTS

DEVICE_IDENTIFIER

This constant is used to identify a Tilt 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 Tilt Bricklet.

CALLBACK_TILT_STATE

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

FUNCTION_GET_TILT_STATE

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

FUNCTION_ENABLE_TILT_STATE_CALLBACK

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

FUNCTION_DISABLE_TILT_STATE_CALLBACK

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

FUNCTION_IS_TILT_STATE_CALLBACK_ENABLED

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_tilt_state()

Returns the current tilt state. The state can either be

* 0 = Closed: The ball in the tilt switch closes the circuit. * 1 = Open: The ball in the tilt switch does not close the circuit. * 2 = Closed Vibrating: The tilt switch is in motion (rapid change between open and close).

.. image:: /Images/Bricklets/bricklet_tilt_mechanics.jpg :scale: 100 % :alt: Tilt states :align: center :target: ../../_images/Bricklets/bricklet_tilt_mechanics.jpg

enable_tilt_state_callback()

Enables the :cb:`Tilt State` callback.

disable_tilt_state_callback()

Disables the :cb:`Tilt State` callback.

is_tilt_state_callback_enabled()

Returns *true* if the :cb:`Tilt State` callback is enabled.

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|