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
Modifier and TypeFieldDescriptionprotected boolean
To check if the buzzer is active or not -
Constructor Summary
ConstructorDescriptionActiveBuzzerHelper
(com.pi4j.io.pwm.Pwm activeBuzzer) BuzzerHelper constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
Turns the active buzzer off.void
Turns the active buzzer on by setting the duty cycle is 100 and frequency to 440hz.void
beep()
Beep powers on, plays a single tone from the active buzzer for 2 seconds then powers down.void
Intermittent tone will play a tone for a 20 seconds duration.void
Uses 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.
-