The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Tinkerforge::BrickletTilt - Device for sensing tilt and vibration

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.

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 :func:`TiltState` callback.

disable_tilt_state_callback()

Disables the :func:`TiltState` callback.

is_tilt_state_callback_enabled()

Returns *true* if the :func:`TiltState` 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|