public class PFMate extends I2CSensor
Modifier and Type | Field and Description |
---|---|
PFMateMotor |
A |
PFMateMotor |
B |
static int |
DEFAULT_PFMATE_ADDRESS |
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 |
---|
PFMate(I2CPort port,
int channel)
Constructor takes in the sensor port and the PF channel you will be using
|
PFMate(I2CPort port,
int channel,
int address)
Constructor takes in the sensor port and the PF channel you will be using
|
PFMate(Port port,
int channel)
Constructor takes in the sensor port and the PF channel you will be using
|
PFMate(Port port,
int channel,
int address)
Constructor takes in the sensor port and the PF channel you will be using
|
Modifier and Type | Method and Description |
---|---|
int |
getChannel()
Returns the current IR channel in use by the PF Mate
|
int |
getMotor()
Returns which motors are activated
|
void |
setChannel(int channel)
Sets PF channel to use.
|
void |
setMotor(int motor)
Determines which motors are to be used buy default both are activated
|
void |
update()
Sends command to PF IR receiver to apply changes made to the registers.
|
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 PFMateMotor A
public PFMateMotor B
public static final int DEFAULT_PFMATE_ADDRESS
public PFMate(I2CPort port, int channel)
port
- sensor portchannel
- PF Channel 1-4public PFMate(I2CPort port, int channel, int address)
port
- sensor portchannel
- PF Channel 1-4address
- I2C address of the controllerpublic PFMate(Port port, int channel)
port
- sensor portchannel
- PF Channel 1-4public PFMate(Port port, int channel, int address)
port
- sensor portchannel
- PF Channel 1-4address
- I2C address of the controllerpublic void update()
public void setChannel(int channel)
channel
- 1-4public void setMotor(int motor)
motor
- 0 both, 1 motor A or 2 motor Bpublic int getChannel()
public int getMotor()