Class BrickletTilt


  • public class BrickletTilt
    extends Device
    Detects inclination of Bricklet (tilt switch open/closed)
    • Field Detail

      • DEVICE_DISPLAY_NAME

        public static final java.lang.String DEVICE_DISPLAY_NAME
        See Also:
        Constant Field Values
      • FUNCTION_GET_TILT_STATE

        public static final byte FUNCTION_GET_TILT_STATE
        See Also:
        Constant Field Values
      • FUNCTION_ENABLE_TILT_STATE_CALLBACK

        public static final byte FUNCTION_ENABLE_TILT_STATE_CALLBACK
        See Also:
        Constant Field Values
      • FUNCTION_DISABLE_TILT_STATE_CALLBACK

        public static final byte FUNCTION_DISABLE_TILT_STATE_CALLBACK
        See Also:
        Constant Field Values
      • FUNCTION_IS_TILT_STATE_CALLBACK_ENABLED

        public static final byte FUNCTION_IS_TILT_STATE_CALLBACK_ENABLED
        See Also:
        Constant Field Values
      • TILT_STATE_CLOSED_VIBRATING

        public static final short TILT_STATE_CLOSED_VIBRATING
        See Also:
        Constant Field Values
    • Constructor Detail

      • BrickletTilt

        public BrickletTilt​(java.lang.String uid,
                            IPConnection ipcon)
        Creates an object with the unique device ID \c uid. and adds it to the IP Connection \c ipcon.
    • Method Detail

      • getTiltState

        public short getTiltState()
                           throws TinkerforgeException
        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
        Throws:
        TinkerforgeException
      • getIdentity

        public Device.Identity getIdentity()
                                    throws TinkerforgeException
        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', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port). A Bricklet connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always at position 'z'. The device identifier numbers can be found :ref:`here <device_identifier>`. |device_identifier_constant|
        Specified by:
        getIdentity in class Device
        Throws:
        TinkerforgeException