Class ActiveBuzzerHelper

java.lang.Object
com.opensourcewithslu.outputdevices.ActiveBuzzerHelper

public class ActiveBuzzerHelper extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
    To check if the buzzer is active or not
  • Constructor Summary

    Constructors
    Constructor
    Description
    ActiveBuzzerHelper(com.pi4j.io.pwm.Pwm activeBuzzer)
    BuzzerHelper constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Turns the active buzzer off.
    void
    Turns the active buzzer on by setting the duty cycle is 100 and frequency to 440hz.
    void
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • actBuzzCheck

      protected boolean actBuzzCheck
      To 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.