|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lejos.nxt.I2CSensor lejos.nxt.addon.LMotor
public class LMotor
Generic abstraction to manage RC Servos and DC Motor. LServo and LDCMotor uses inherits from this class
Field Summary | |
---|---|
static int[] |
arrMotorLoad
|
static int[] |
arrMotorUnload
|
protected int |
LSC_position
|
protected byte |
SPI_PORT
|
Fields inherited from class lejos.nxt.I2CSensor |
---|
PRODUCT_ID, SENSOR_TYPE, VERSION |
Constructor Summary | |
---|---|
LMotor(SensorPort port,
int location,
String name,
byte SPI_PORT)
Constructor |
Method Summary | |
---|---|
String |
getName()
Get name from a RC Servo or a DC Motor |
protected int |
getPulse()
This method return current pulse over a RC Servo or a DC Motor. |
boolean |
isMoving()
Method to know if Servo is moving to a determinated angle |
void |
load()
Load Servo located in a position X |
void |
setDelay(int delay)
Set a delay in a Motor |
protected void |
setPulse(int pulse)
This class set the Pulse over a RC Servo or a DC Motor |
void |
unload()
|
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 |
---|
protected int LSC_position
protected byte SPI_PORT
public static final int[] arrMotorUnload
public static final int[] arrMotorLoad
Constructor Detail |
---|
public LMotor(SensorPort port, int location, String name, byte SPI_PORT)
port
- the portlocation
- the locationname
- the name of the servoSPI_PORT
- the SPI portMethod Detail |
---|
public boolean isMoving()
public void setDelay(int delay)
delay
- the delaypublic void unload()
public void load()
public String getName()
protected void setPulse(int pulse)
pulse
- protected int getPulse()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |