Class ActiveBuzzerHelper
java.lang.Object
com.opensourcewithslu.outputdevices.ActiveBuzzerHelper
The ActiveBuzzerHelper class contains methods that pertain to the control of the active buzzer.
IMPORTANT NOTE: WIRING MUST BE DIRECT. USAGE OF TRANSISTOR ALTERS THE FUNCTIONALITIES OF THE HELPER.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanTo check if the buzzer is active or not -
Constructor Summary
ConstructorsConstructorDescriptionActiveBuzzerHelper(com.pi4j.io.pwm.Pwm activeBuzzer) BuzzerHelper constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidTurns the active buzzer off.voidTurns the active buzzer on by setting the duty cycle is 100 and frequency to 440hz.voidbeep()Beep powers on, plays a single tone from the active buzzer for 2 seconds then powers down.voidIntermittent tone will play a tone for a 20 seconds duration.voidUses the active buzzer on and off function to beep the word pi in morse code.
-
Field Details
-
actBuzzCheck
protected boolean actBuzzCheckTo check if the buzzer is active or not
-
-
Constructor Details
-
ActiveBuzzerHelper
public ActiveBuzzerHelper(com.pi4j.io.pwm.Pwm activeBuzzer) BuzzerHelper constructor- Parameters:
activeBuzzer- instance of a Pwm object
-
-
Method Details
-
activeBuzzerOn
public void activeBuzzerOn()Turns the active buzzer on by setting the duty cycle is 100 and frequency to 440hz. -
activeBuzzerOff
public void activeBuzzerOff()Turns the active buzzer off. -
beep
public void beep()Beep powers on, plays a single tone from the active buzzer for 2 seconds then powers down. -
intermittentTone
public void intermittentTone()Intermittent tone will play a tone for a 20 seconds duration. During this duration the buzzer will be on for 10 seconds and off for 10 seconds. -
morseCodeTone
public void morseCodeTone()Uses the active buzzer on and off function to beep the word pi in morse code.
-