|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pt.citar.diablu.nxt.protocol.NXTCommand pt.citar.diablu.nxt.protocol.NXTCommandPlayTone
public class NXTCommandPlayTone
Represents the PLAYTONE Command.
The response to this command (if required) is a NXTResponseStatus
.
Example 1:
Example 2:
NXTResponseStatus
Constructor Summary | |
---|---|
NXTCommandPlayTone()
|
|
NXTCommandPlayTone(int frequency,
int duration)
Constructs a new NXTCommandPlayTone object with a given frequency and duration and
with no response requirement. |
|
NXTCommandPlayTone(int frequency,
int duration,
boolean responseRequired)
Constructs a new NXTCommandPlayTone object with a given frequency, duration and
response requirement. |
Method Summary | |
---|---|
int |
getDuration()
Returns the current duration set to be played when the command is sent. |
int |
getFrequency()
Returns the current frequency set to be played when the command is sent. |
void |
setDuration(int duration)
Sets the duration of the tone to play. |
void |
setFrequency(int frequency)
Sets the frequency of the tone to play. |
Methods inherited from class pt.citar.diablu.nxt.protocol.NXTCommand |
---|
getPacketLength, isResponseRequired, sendCommand, setResponseRequired, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NXTCommandPlayTone()
public NXTCommandPlayTone(int frequency, int duration)
NXTCommandPlayTone
object with a given frequency and duration and
with no response requirement.
frequency
- The frequency of the tone. Only the two least significant bytes are considered.duration
- The duration of the tone. Only the two least significatn bytes are considered.public NXTCommandPlayTone(int frequency, int duration, boolean responseRequired)
NXTCommandPlayTone
object with a given frequency, duration and
response requirement.
frequency
- The frequency of the tone. Only the two least significant bytes are considered.duration
- The duration of the tone. Only the two least significatn bytes are considered.responseRequired
- Indicates if a response to this command is required.Method Detail |
---|
public int getFrequency()
public void setFrequency(int frequency)
frequency
- The frequency to play. On the two least significant bytes are considered.public int getDuration()
public void setDuration(int duration)
duration
- The frequency to play. On the two least significant bytes are considered.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |