jcontrol.io
Class Buzzer

java.lang.Object
  extended by jcontrol.io.Buzzer
All Implemented Interfaces:
SoundDevice

public class Buzzer
extends Object
implements SoundDevice

Makes some noise using the buzzer connected to the JControl module. Wrapper for class PWM.


Constructor Summary
Buzzer()
          Constructs a new Buzzer.
 
Method Summary
 void off()
          Turns off the Buzzer.
 void on(int frequency)
          Turns on the Buzzer with the specified frequency.
 void on(int frequency, int duration)
          Turns on the Buzzer with the specified frequency and duration.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, notifyAll, toString, wait
 

Constructor Detail

Buzzer

public Buzzer()
Constructs a new Buzzer.

Method Detail

on

public void on(int frequency)
Turns on the Buzzer with the specified frequency. The noise will last until invoking off.

Specified by:
on in interface SoundDevice
Parameters:
frequency - to use (range 250 ... 32767 Hz)

off

public void off()
Turns off the Buzzer.

Specified by:
off in interface SoundDevice

on

public void on(int frequency,
               int duration)
Turns on the Buzzer with the specified frequency and duration.

Specified by:
on in interface SoundDevice
Parameters:
frequency - to use (range 250 ... 32767 Hz)
duration - for the noise (range 1 ... 32767 ms)