public class NxtDirectCommands extends LegoMindstormsNxtBase
bluetooth, logTag
form
ACCELEROMETER_SENSITIVITY_MODERATE, ACCELEROMETER_SENSITIVITY_STRONG, ACCELEROMETER_SENSITIVITY_WEAK, ALIGNMENT_CENTER, ALIGNMENT_NORMAL, ALIGNMENT_OPPOSITE, ASSET_DIRECTORY, BUTTON_SHAPE_DEFAULT, BUTTON_SHAPE_OVAL, BUTTON_SHAPE_RECT, BUTTON_SHAPE_ROUNDED, COLOR_BLACK, COLOR_BLUE, COLOR_CYAN, COLOR_DEFAULT, COLOR_DKGRAY, COLOR_GRAY, COLOR_GREEN, COLOR_LTGRAY, COLOR_MAGENTA, COLOR_NONE, COLOR_ORANGE, COLOR_PINK, COLOR_RED, COLOR_WHITE, COLOR_YELLOW, DEFAULT_VALUE_COLOR_BLACK, DEFAULT_VALUE_COLOR_BLUE, DEFAULT_VALUE_COLOR_CYAN, DEFAULT_VALUE_COLOR_DEFAULT, DEFAULT_VALUE_COLOR_DKGRAY, DEFAULT_VALUE_COLOR_GRAY, DEFAULT_VALUE_COLOR_GREEN, DEFAULT_VALUE_COLOR_LTGRAY, DEFAULT_VALUE_COLOR_MAGENTA, DEFAULT_VALUE_COLOR_NONE, DEFAULT_VALUE_COLOR_ORANGE, DEFAULT_VALUE_COLOR_PINK, DEFAULT_VALUE_COLOR_RED, DEFAULT_VALUE_COLOR_WHITE, DEFAULT_VALUE_COLOR_YELLOW, DIRECTION_EAST, DIRECTION_MAX, DIRECTION_MIN, DIRECTION_NONE, DIRECTION_NORTH, DIRECTION_NORTHEAST, DIRECTION_NORTHWEST, DIRECTION_SOUTH, DIRECTION_SOUTHEAST, DIRECTION_SOUTHWEST, DIRECTION_WEST, FONT_DEFAULT_SIZE, LAYOUT_ORIENTATION_HORIZONTAL, LAYOUT_ORIENTATION_VERTICAL, LENGTH_FILL_PARENT, LENGTH_PREFERRED, LENGTH_UNKNOWN, SLIDER_MAX_VALUE, SLIDER_MIN_VALUE, SLIDER_THUMB_VALUE, TOAST_LENGTH_LONG, TOAST_LENGTH_SHORT, TYPEFACE_DEFAULT, TYPEFACE_MONOSPACE, TYPEFACE_SANSSERIF, TYPEFACE_SERIF
Constructor and Description |
---|
NxtDirectCommands(ComponentContainer container)
Creates a new NxtDirectCommands component.
|
Modifier and Type | Method and Description |
---|---|
void |
DeleteFile(java.lang.String fileName) |
void |
DownloadFile(java.lang.String source,
java.lang.String destination)
Download a file to the robot.
|
int |
GetBatteryLevel() |
java.lang.String |
GetBrickName() |
java.lang.String |
GetCurrentProgramName() |
java.util.List<java.lang.String> |
GetFirmwareVersion() |
java.util.List<java.lang.Object> |
GetInputValues(java.lang.String sensorPortLetter) |
java.util.List<java.lang.Number> |
GetOutputState(java.lang.String motorPortLetter) |
long |
KeepAlive() |
java.util.List<java.lang.String> |
ListFiles(java.lang.String wildcard) |
int |
LsGetStatus(java.lang.String sensorPortLetter) |
java.util.List<java.lang.Integer> |
LsRead(java.lang.String sensorPortLetter) |
void |
LsWrite(java.lang.String sensorPortLetter,
YailList list,
int rxDataLength) |
java.lang.String |
MessageRead(int mailbox) |
void |
MessageWrite(int mailbox,
java.lang.String message) |
void |
PlaySoundFile(java.lang.String fileName) |
void |
PlayTone(int frequencyHz,
int durationMs) |
void |
ResetInputScaledValue(java.lang.String sensorPortLetter) |
void |
ResetMotorPosition(java.lang.String motorPortLetter,
boolean relative) |
void |
SetBrickName(java.lang.String name) |
void |
SetInputMode(java.lang.String sensorPortLetter,
int sensorType,
int sensorMode) |
void |
SetOutputState(java.lang.String motorPortLetter,
int power,
int mode,
int regulationMode,
int turnRatio,
int runState,
long tachoLimit) |
void |
StartProgram(java.lang.String programName) |
void |
StopProgram() |
void |
StopSoundPlayback() |
afterConnect, beforeDisconnect, BluetoothClient, BluetoothClient, checkBluetooth, convertMotorPortLetterToNumber, convertMotorPortLetterToNumber, convertSensorPortLetterToNumber, convertSensorPortLetterToNumber, copyBooleanValueToBytes, copySBYTEValueToBytes, copySLONGValueToBytes, copyStringValueToBytes, copySWORDValueToBytes, copyUBYTEValueToBytes, copyULONGValueToBytes, copyUWORDValueToBytes, evaluateStatus, getBooleanValueFromBytes, getInputValues, getSBYTEValueFromBytes, getSLONGValueFromBytes, getStatus, getStringValueFromBytes, getStringValueFromBytes, getSWORDValueFromBytes, getUBYTEValueFromBytes, getULONGValueFromBytes, getUWORDValueFromBytes, Initialize, lsGetStatus, lsRead, lsWrite, onDelete, resetInputScaledValue, sanitizePower, sanitizeTurnRatio, sendCommand, sendCommandAndReceiveReturnPackage, setInputMode, setOutputState
getDispatchDelegate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDispatchDelegate
public NxtDirectCommands(ComponentContainer container)
public void StartProgram(java.lang.String programName)
public void StopProgram()
public void PlaySoundFile(java.lang.String fileName)
public void PlayTone(int frequencyHz, int durationMs)
public void SetOutputState(java.lang.String motorPortLetter, int power, int mode, int regulationMode, int turnRatio, int runState, long tachoLimit)
public void SetInputMode(java.lang.String sensorPortLetter, int sensorType, int sensorMode)
public java.util.List<java.lang.Number> GetOutputState(java.lang.String motorPortLetter)
public java.util.List<java.lang.Object> GetInputValues(java.lang.String sensorPortLetter)
public void ResetInputScaledValue(java.lang.String sensorPortLetter)
public void MessageWrite(int mailbox, java.lang.String message)
public void ResetMotorPosition(java.lang.String motorPortLetter, boolean relative)
public int GetBatteryLevel()
public void StopSoundPlayback()
public long KeepAlive()
public int LsGetStatus(java.lang.String sensorPortLetter)
public void LsWrite(java.lang.String sensorPortLetter, YailList list, int rxDataLength)
public java.util.List<java.lang.Integer> LsRead(java.lang.String sensorPortLetter)
public java.lang.String GetCurrentProgramName()
public java.lang.String MessageRead(int mailbox)
public void DownloadFile(java.lang.String source, java.lang.String destination)
MediaUtil.determineMediaSource(com.google.appinventor.components.runtime.Form, java.lang.String)
for information about what
a path can be.source
- the path of the file to downloaddestination
- the name of the file on the robotpublic void DeleteFile(java.lang.String fileName)
public java.util.List<java.lang.String> ListFiles(java.lang.String wildcard)
public java.util.List<java.lang.String> GetFirmwareVersion()
public void SetBrickName(java.lang.String name)
public java.lang.String GetBrickName()