Package lejos.hardware.device
Class PFMotorPort
- java.lang.Object
-
- lejos.hardware.device.PFMotorPort
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,BasicMotorPort,IOPort
public class PFMotorPort extends java.lang.Object implements BasicMotorPort
MotorPort for PF Motors using HiTechnic IRLink- Author:
- Lawrie Griffiths
-
-
Constructor Summary
Constructors Constructor Description PFMotorPort(IRLink link, int channel, int slot)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the port, the port can not be used after this call.voidcontrolMotor(int power, int mode)java.lang.StringgetName()Return the string representing this portbooleansetPinMode(int mode)Set the port pins up ready for use.voidsetPWMMode(int mode)
-
-
-
Constructor Detail
-
PFMotorPort
public PFMotorPort(IRLink link, int channel, int slot)
-
-
Method Detail
-
controlMotor
public void controlMotor(int power, int mode)- Specified by:
controlMotorin interfaceBasicMotorPort
-
setPWMMode
public void setPWMMode(int mode)
- Specified by:
setPWMModein interfaceBasicMotorPort
-
close
public void close()
Description copied from interface:IOPortClose the port, the port can not be used after this call.
-
getName
public java.lang.String getName()
Description copied from interface:IOPortReturn the string representing this port
-
setPinMode
public boolean setPinMode(int mode)
Description copied from interface:IOPortSet the port pins up ready for use.- Specified by:
setPinModein interfaceIOPort- Parameters:
mode- The EV3 pin mode- Returns:
- true if the operation succeeds false if it fails
-
-