|
|||||||||
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.MServo
public class MServo
MServo, is a abstraction to model any RC Servo (continuous and non continuous) plugged to
Field Summary |
---|
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_CUSTOM, 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 | |
---|---|
MServo(SensorPort port,
int location)
The initial Constructor. |
|
MServo(SensorPort port,
int location,
String servoName)
The initial Constructor. |
|
MServo(SensorPort port,
int location,
String servoName,
int min_angle,
int max_angle)
Constructor with the feature to set min, max and init angle |
Method Summary | |
---|---|
int |
getAngle()
Return the angle used in last operation |
int |
getPulse()
Return the pulse used in last operation |
void |
setAngle(int angle)
Method to set an Angle in a RC Servo. |
void |
setPulse(int pulse)
This method set the pulse in a RC Servo. |
void |
setSpeed(int speed)
Method to set the Speed in a RC Servo. |
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 |
Constructor Detail |
---|
public MServo(SensorPort port, int location)
port
- location
- public MServo(SensorPort port, int location, String servoName)
port
- location
- servoName
- public MServo(SensorPort port, int location, String servoName, int min_angle, int max_angle)
port
- location
- servoName
- min_angle
- max_angle
- Method Detail |
---|
public void setPulse(int pulse)
pulse
- the pulse widthpublic int getPulse()
public void setAngle(int angle)
angle
- the anglepublic int getAngle()
public void setSpeed(int speed)
speed
- the speed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |