public class BrickletPiezoBuzzer extends Device
Modifier and Type | Class and Description |
---|---|
static interface |
BrickletPiezoBuzzer.BeepFinishedListener
This listener is triggered if a beep set by
beep(long) is finished |
static interface |
BrickletPiezoBuzzer.MorseCodeFinishedListener
This listener is triggered if the playback of the morse code set by
morseCode(String) is finished. |
Device.Identity
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEVICE_DISPLAY_NAME |
static int |
DEVICE_IDENTIFIER |
static byte |
FUNCTION_BEEP |
static byte |
FUNCTION_GET_IDENTITY |
static byte |
FUNCTION_MORSE_CODE |
Constructor and Description |
---|
BrickletPiezoBuzzer(java.lang.String uid,
IPConnection ipcon)
Creates an object with the unique device ID \c uid.
|
Modifier and Type | Method and Description |
---|---|
void |
addBeepFinishedListener(BrickletPiezoBuzzer.BeepFinishedListener listener)
Adds a BeepFinished listener.
|
void |
addMorseCodeFinishedListener(BrickletPiezoBuzzer.MorseCodeFinishedListener listener)
Adds a MorseCodeFinished listener.
|
void |
beep(long duration)
Beeps for the given duration.
|
Device.Identity |
getIdentity()
Returns the UID, the UID where the Bricklet is connected to,
the position, the hardware and firmware version as well as the
device identifier.
|
void |
morseCode(java.lang.String morse)
Sets morse code that will be played by the piezo buzzer.
|
void |
removeBeepFinishedListener(BrickletPiezoBuzzer.BeepFinishedListener listener)
Removes a BeepFinished listener.
|
void |
removeMorseCodeFinishedListener(BrickletPiezoBuzzer.MorseCodeFinishedListener listener)
Removes a MorseCodeFinished listener.
|
getAPIVersion, getResponseExpected, setResponseExpected, setResponseExpectedAll
public static final int DEVICE_IDENTIFIER
public static final java.lang.String DEVICE_DISPLAY_NAME
public static final byte FUNCTION_BEEP
public static final byte FUNCTION_MORSE_CODE
public static final byte FUNCTION_GET_IDENTITY
public BrickletPiezoBuzzer(java.lang.String uid, IPConnection ipcon)
public void beep(long duration) throws TinkerforgeException
TinkerforgeException
public void morseCode(java.lang.String morse) throws TinkerforgeException
TinkerforgeException
public Device.Identity getIdentity() throws TinkerforgeException
getIdentity
in class Device
TinkerforgeException
public void addBeepFinishedListener(BrickletPiezoBuzzer.BeepFinishedListener listener)
public void removeBeepFinishedListener(BrickletPiezoBuzzer.BeepFinishedListener listener)
public void addMorseCodeFinishedListener(BrickletPiezoBuzzer.MorseCodeFinishedListener listener)
public void removeMorseCodeFinishedListener(BrickletPiezoBuzzer.MorseCodeFinishedListener listener)
Copyright © 2021 Tinkerforge GmbH. All rights reserved.