public class PFLink extends I2CSensor
address, DEFAULT_I2C_ADDRESS, port, REG_PRODUCT_ID, REG_VENDOR_ID, REG_VERSION, retryCount
currentMode, modes
BLACK, BLANK_INDEX, BLUE, BLUE_INDEX, BROWN, GREEN, GREEN_INDEX, MAX_TYPE, MIN_TYPE, MODE_RAW, NXT_ADC_RES, RED, RED_INDEX, TYPE_ANGLE, TYPE_COLORBLUE, TYPE_COLORFULL, TYPE_COLORGREEN, TYPE_COLORNONE, TYPE_COLORRED, TYPE_CUSTOM, TYPE_HIGHSPEED, TYPE_HIGHSPEED_9V, TYPE_HISPEED, TYPE_LIGHT_ACTIVE, TYPE_LIGHT_INACTIVE, TYPE_LOWSPEED, TYPE_LOWSPEED_9V, TYPE_NO_SENSOR, TYPE_REFLECTION, TYPE_SOUND_DB, TYPE_SOUND_DBA, TYPE_SWITCH, TYPE_TEMPERATURE, WHITE, YELLOW
Constructor and Description |
---|
PFLink(I2CPort _Port) |
PFLink(I2CPort _Port,
int address) |
PFLink(Port _Port) |
PFLink(Port _Port,
int address) |
Modifier and Type | Method and Description |
---|---|
void |
initialize(byte _Range)
Should be called once to set up the NRLink for usage in the program
|
void |
installDefaultMacros()
Installs the macro definitions used by this class.
|
void |
installMacro(int _Address,
byte[] _Macro)
Installs a macro into the NRLink
You really should call this only once for a new NRLink since
it stores them in EEPROM even if turned of.
|
void |
runCommand(int command)
Executes a command
|
void |
runMacro(int _Address)
Runs a macro which has been previously installed on the NRLink.
|
fetchString, getAddress, getData, getData, getPort, getProductID, getRetryCount, getVendorID, getVersion, sendData, sendData, sendData, setAddress, setRetryCount
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModes
close, releaseOnClose
public static final byte NR_RANGE_SHORT
public static final byte NR_RANGE_LONG
public static final int MOTOR_CH1_A_FLOAT
public static final int MOTOR_CH1_A_FORWARD
public static final int MOTOR_CH1_A_REVERSE
public static final int MOTOR_CH1_A_BRAKE
public static final int MOTOR_CH1_B_FLOAT
public static final int MOTOR_CH1_B_FORWARD
public static final int MOTOR_CH1_B_REVERSE
public static final int MOTOR_CH1_B_BRAKE
public static final int MOTOR_CH2_A_FLOAT
public static final int MOTOR_CH2_A_FORWARD
public static final int MOTOR_CH2_A_REVERSE
public static final int MOTOR_CH2_A_BRAKE
public static final int MOTOR_CH2_B_FLOAT
public static final int MOTOR_CH2_B_FORWARD
public static final int MOTOR_CH2_B_REVERSE
public static final int MOTOR_CH2_B_BRAKE
public static final int MOTOR_CH3_A_FLOAT
public static final int MOTOR_CH3_A_FORWARD
public static final int MOTOR_CH3_A_REVERSE
public static final int MOTOR_CH3_A_BRAKE
public static final int MOTOR_CH3_B_FLOAT
public static final int MOTOR_CH3_B_FORWARD
public static final int MOTOR_CH3_B_REVERSE
public static final int MOTOR_CH3_B_BRAKE
public static final int MOTOR_CH4_A_FLOAT
public static final int MOTOR_CH4_A_FORWARD
public static final int MOTOR_CH4_A_REVERSE
public static final int MOTOR_CH4_A_BRAKE
public static final int MOTOR_CH4_B_FLOAT
public static final int MOTOR_CH4_B_FORWARD
public static final int MOTOR_CH4_B_REVERSE
public static final int MOTOR_CH4_B_BRAKE
public static final int COMBO_CH1_A_FORWARD_B_FORWARD
public static final int COMBO_CH1_A_FORWARD_B_REVERSE
public static final int COMBO_CH1_A_REVERSE_B_FORWARD
public static final int COMBO_CH1_A_REVERSE_B_REVERSE
public static final int COMBO_CH2_A_FORWARD_B_FORWARD
public static final int COMBO_CH2_A_FORWARD_B_REVERSE
public static final int COMBO_CH2_A_REVERSE_B_FORWARD
public static final int COMBO_CH2_A_REVERSE_B_REVERSE
public static final int COMBO_CH3_A_FORWARD_B_FORWARD
public static final int COMBO_CH3_A_FORWARD_B_REVERSE
public static final int COMBO_CH3_A_REVERSE_B_FORWARD
public static final int COMBO_CH3_A_REVERSE_B_REVERSE
public static final int COMBO_CH4_A_FORWARD_B_FORWARD
public static final int COMBO_CH4_A_FORWARD_B_REVERSE
public static final int COMBO_CH4_A_REVERSE_B_FORWARD
public static final int COMBO_CH4_A_REVERSE_B_REVERSE
public PFLink(I2CPort _Port, int address)
public PFLink(I2CPort _Port)
public PFLink(Port _Port, int address)
public PFLink(Port _Port)
public void initialize(byte _Range)
_Range
- Either NR_RANGE_SHORT or NR_RANGE_LONG, which uses more powerpublic void runCommand(int command)
command
- public void installMacro(int _Address, byte[] _Macro)
_Address
- The address up from 0x40 for the macro_Macro
- The macropublic void installDefaultMacros()
public void runMacro(int _Address)
_Address
- The address of the macro, one of the MOTOR_* for a single motor
or one of the COMBO_* macros which work on both motors simultaneously