|
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.scribbler.ScribblerSpeaker
public class ScribblerSpeaker
Device for controlling the speaker on the Scribbler. The Scribbler's speaker can play two notes simultaneously. The notes are played for a specified duration.
Note: The Scribbler is not able to accept any other commands while the speaker is playing. Thus, all sensor updates are suspended while the speaker is playing and are restarted when it completes.
| Field Summary |
|---|
| Fields inherited from class dlife.robot.Device |
|---|
DEFAULT_GUI_UPDATE_DELAY, DEFAULT_READ_DELAY, myRobot, readCount |
| Constructor Summary | |
|---|---|
ScribblerSpeaker()
Construct a new ScribblerSpeaker device. |
|
| Method Summary | |
|---|---|
protected DeviceDisplay[] |
createGUIObjects()
Get the GUI for this ScribblerSpeaker device. |
void |
freeze()
Does nothing. |
int |
getDuration()
The duration for which the note/notes was/were played. |
int |
getNoteOneFrequency()
Get the frequency of note one. |
int |
getNoteTwoFrequency()
Get the frequency of note two. |
void |
playNote(int noteFrequency,
int duration)
Play the specified note for the specified duration. |
void |
playNotes(int noteOneFrequency,
int noteTwoFrequency,
int duration)
Play the specified pair of notes for the specified duration. |
void |
readStateFromRobot()
This method does nothing for the ScribblerSpeaker. |
void |
startUp()
Startup the ScribblerSpeaker device. |
| Methods inherited from class dlife.robot.Device |
|---|
getAutoRead, getGUI, getGUIUpdateDelay, getReadDelay, getRobot, getSensorReadCount, getSensorReadRate, setAutoRead, setGUIUpdateDelay, setReadDelay, setRobot, shutDown, 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 ScribblerSpeaker()
| Method Detail |
|---|
public void startUp()
startUp in class Devicepublic void freeze()
freeze in class Devicepublic void readStateFromRobot()
readStateFromRobot in class Device
public void playNote(int noteFrequency,
int duration)
noteFrequency - the frequency of the note to be played.duration - the duration (in ms) that the note should be played.
public void playNotes(int noteOneFrequency,
int noteTwoFrequency,
int duration)
noteOneFrequency - the frequency of one of the notes to be played.noteTwoFrequency - the frequency of the other note to be played.duration - the duration (in ms) that the notes should be played.public int getNoteOneFrequency()
public int getNoteTwoFrequency()
public int getDuration()
protected DeviceDisplay[] createGUIObjects()
createGUIObjects in class Device
|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||