Modbus - Piezo Buzzer Bricklet

This is the description of the Modbus protocol for the Piezo Buzzer Bricklet. General information and technical specifications for the Piezo Buzzer Bricklet are summarized in its hardware description.

API

A general description of the Modbus protocol structure can be found here.

Basic Functions

BrickletPiezoBuzzer.beep
Function ID:

1

Request:
  • duration -- uint32
Response:

no response

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

BrickletPiezoBuzzer.morse_code
Function ID:

2

Request:
  • morse -- char[60]
Response:

no response

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.

Advanced Functions

BrickletPiezoBuzzer.get_identity
Function ID:

255

Request:

empty payload

Response:
  • uid -- char[8]
  • connected_uid -- char[8]
  • position -- char
  • hardware_version -- uint8[3]
  • firmware_version -- uint8[3]
  • device_identifier -- uint16

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 here

Callbacks

BrickletPiezoBuzzer.CALLBACK_BEEP_FINISHED
Function ID:3
Response:empty payload

This callback is triggered if a beep set by beep is finished

BrickletPiezoBuzzer.CALLBACK_MORSE_CODE_FINISHED
Function ID:4
Response:empty payload

This callback is triggered if the playback of the morse code set by morse_code is finished.