lejos.nxt.addon
Class PFMate

java.lang.Object
  extended by lejos.nxt.I2CSensor
      extended by lejos.nxt.addon.PFMate
All Implemented Interfaces:
SensorConstants

public class PFMate
extends I2CSensor

Supports Mindsensors PF Mate
This device is used to control Lego Power Function IR receiver

Author:
Michael Smith

Field Summary
 PFMateMotor A
           
 PFMateMotor B
           
 
Fields inherited from class lejos.nxt.I2CSensor
PRODUCT_ID, SENSOR_TYPE, VERSION
 
Fields inherited from interface lejos.nxt.SensorConstants
MODE_ANGLESTEP, MODE_BOOLEAN, MODE_CELSIUS, MODE_FARENHEIT, MODE_PCTFULLSCALE, MODE_PERIODCOUNTER, MODE_RAW, MODE_TRANSITIONCNT, TYPE_ANGLE, TYPE_COLORBLUE, TYPE_COLORFULL, TYPE_COLORGREEN, TYPE_COLORNONE, TYPE_COLORRED, TYPE_CUSTOM, 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
 
Constructor Summary
PFMate(I2CPort port, int channel)
          Constructor takes in the sensor port and the PF channel you will be using
 
Method Summary
 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.
 
Methods inherited from class lejos.nxt.I2CSensor
fetchString, getData, getPort, getProductID, getSensorType, getVersion, sendData, sendData, setAddress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

A

public PFMateMotor A

B

public PFMateMotor B
Constructor Detail

PFMate

public PFMate(I2CPort port,
              int channel)
Constructor takes in the sensor port and the PF channel you will be using

Parameters:
port - sensor port
channel - PF Channel 1-4
Method Detail

update

public void update()
Sends command to PF IR receiver to apply changes made to the registers. Call this after You have set speed, direction and/or channel.


setChannel

public void setChannel(int channel)
Sets PF channel to use.

Parameters:
channel - 1-4

setMotor

public void setMotor(int motor)
Determines which motors are to be used buy default both are activated

Parameters:
motor - 0 both, 1 motor A or 2 motor B

getChannel

public int getChannel()
Returns the current IR channel in use by the PF Mate

Returns:
int 1-4

getMotor

public int getMotor()
Returns which motors are activated

Returns:
int 0 both, 1 motor A or 2 motor B