|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
dlife.robot.Device
dlife.robot.finch.FinchBuzzer
public class FinchBuzzer
A class for controlling the Finch's buzzer. The Finch has a frequency controllable on-board buzzer that can play notes ranging from 100 Hz to 10,000 Hz. The buzzer is initialized to Middle-C.
| Field Summary |
|---|
| Fields inherited from class dlife.robot.Device |
|---|
DEFAULT_GUI_UPDATE_DELAY, DEFAULT_READ_DELAY, myRobot, readCount |
| Constructor Summary | |
|---|---|
FinchBuzzer()
Construct a new FinchBuzzer object. |
|
| Method Summary | |
|---|---|
void |
buzz(int frequency,
int duration)
Turn the buzzer on at the specified frequency for the specified amount of time. |
protected DeviceDisplay[] |
createGUIObjects()
Get the GUI for the FinchBuzzer. |
void |
freeze()
Turns off the Buzzer when something unexpected happens or after a single step. |
boolean |
isOn()
Check if the buzzer is currently on. |
static void |
main(String[] args)
A little test program that displays the GUI for the FinchBuzzer and allows it to be used to control the Finch. |
void |
readStateFromRobot()
Does nothing. |
void |
shutDown()
Turns the buzzer off when disconnecting from the Finch. |
void |
startUp()
Turns the buzzer off when connecting to the Finch. |
void |
turnOff()
Turn the buzzer off. |
void |
turnOn(int frequency)
Turn on the Finch's buzzer at the specified frequency. |
| Methods inherited from class dlife.robot.Device |
|---|
getAutoRead, getGUI, getGUIUpdateDelay, getReadDelay, getRobot, getSensorReadCount, getSensorReadRate, setAutoRead, setGUIUpdateDelay, setReadDelay, setRobot, startAutoReadTimer, stopAutoReadTimer |
| Methods inherited from class java.util.Observable |
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FinchBuzzer()
| Method Detail |
|---|
public void freeze()
freeze in class Devicepublic void startUp()
startUp in class Devicepublic void shutDown()
shutDown in class Devicepublic void readStateFromRobot()
readStateFromRobot in class Devicepublic void turnOn(int frequency)
frequency - the frequency of the note to play.public boolean isOn()
public void turnOff()
public void buzz(int frequency,
int duration)
frequency - the frequency of the note to play.duration - the length of time to play the note (in ms.)protected DeviceDisplay[] createGUIObjects()
createGUIObjects in class Devicepublic static void main(String[] args)
args - none.
|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||