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

NAME

Tinkerforge::BrickletPiezoBuzzer - Device for controlling a piezo buzzer

CONSTANTS

DEVICE_IDENTIFIER

This constant is used to identify a Piezo Buzzer 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_BEEP_FINISHED

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

CALLBACK_MORSE_CODE_FINISHED

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

FUNCTION_BEEP

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

FUNCTION_MORSE_CODE

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*.

beep()

Beeps with the duration in ms. For example: If you set a value of 1000, the piezo buzzer will beep for one second.

morse_code()

Sets morse code that will be played by the piezo buzzer. The morse code is given as a string consisting of "." (dot), "-" (minus) and " " (space) for *dits*, *dahs* and *pauses*. Every other character is ignored.

For example: If you set the string "...---...", the piezo buzzer will beep nine times with the durations "short short short long long long short short short".

The maximum string size is 60.

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|