|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.bluemelon.bluesense.Device
org.bluemelon.bluesense.ServoDevice
public class ServoDevice
Interface to the servo motor module BM7004. The BM7004 can be used to control up to 8 servo motors.
| Field Summary | |
|---|---|
static int |
BSSERVO_P1
Port value for pin 1 |
static int |
BSSERVO_P2
Port value for pin 2 |
static int |
BSSERVO_P3
Port value for pin 3 |
static int |
BSSERVO_P4
Port value for pin 4 |
static int |
BSSERVO_P5
Port value for pin 5 |
static int |
BSSERVO_P6
Port value for pin 6 |
static int |
BSSERVO_P7
Port value for pin 7 |
static int |
BSSERVO_P8
Port value for pin 8 |
static int |
PROXY_ID
|
static java.lang.String |
PROXY_TITLE
|
static int |
SERVOCOUNT
The number of servos that can be controlled |
static int[] |
SUPPORTS
|
| Constructor Summary | |
|---|---|
ServoDevice(Master master,
int deviceId)
Creates a 'software' servo motor device proxy with a given id. |
|
| Method Summary | |
|---|---|
boolean |
configPending()
Checks if a configuration is being currently being set or being retrieved |
int |
getCurrentAngle(int port)
Returns the current set angle of a specific servo. |
void |
getCurrentAngles(int[] angleArray)
Fills an array with the current set angles. |
int |
getCurrentOffset()
Returns the current set offset configuration parameter |
int |
getPendingAngle(int port)
Returns the angle of a specific servo, which is currently underway to the device |
void |
getPendingAngles(int[] angles)
Fills an array with angles which are currently underway to the device |
boolean |
getRequestGetConfigDone()
Checks if the configuration request is finished |
boolean |
getRequestSetAnglesDone()
Checks if the angle set request is finished |
boolean |
getRequestSetConfigDone()
Checks if the configuration set request is finished |
long |
getTimeOutUs()
Returns the current set time out delay. |
void |
requestGetAngles()
Sends a request to retrieve the current set angles |
void |
requestGetConfiguration()
Request to obtain the configuration settings from a servo Device. |
void |
requestSetAngle(int port,
int angle)
Requests the servo device to set one of its servos to a new angle |
void |
requestSetAngles(int relevantAngles,
int[] angles)
Requests the servo device to set its servos to new angles |
void |
requestSetConfiguration(int offset)
Requests to set the configuration of a servo device. |
void |
setTimeOutUs(int timeOutUs)
Sets the time out value which is used to check if a request was acknowledged in the set time. |
| Methods inherited from class org.bluemelon.bluesense.Device |
|---|
addDeviceEventListener, detect, getFirmwareVersion, getId, getType, getTypeName, isAccessible, removeDeviceEventListener |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROXY_TITLE
public static final int PROXY_ID
public static final int[] SUPPORTS
public static final int SERVOCOUNT
public static final int BSSERVO_P1
public static final int BSSERVO_P2
public static final int BSSERVO_P3
public static final int BSSERVO_P4
public static final int BSSERVO_P5
public static final int BSSERVO_P6
public static final int BSSERVO_P7
public static final int BSSERVO_P8
| Constructor Detail |
|---|
public ServoDevice(Master master,
int deviceId)
master - deviceId - | Method Detail |
|---|
public void requestSetAngles(int relevantAngles,
int[] angles)
relevantAngles - a bit mask indicating which servos to updateangles - a pointer to an array of uint8_t angles with enough space for all servos. @see BLUESENSE_SERVOCONTROLLER_SERVOCOUNT
Only those angles for which a bit in the bit mask is set will be sent to the device.
Note that each angle is value between 0 and 255, the actual physical angle depends on the specifications of the connected servo.
public void requestSetAngle(int port,
int angle)
port - one of the port pin values. @see bsServo_p1angle - an uint8_t representing the new angle of the servo.
Note that each angle is value between 0 and 255, the actual physical angle depends on the specifications of the connected servo.public void requestGetAngles()
public void getPendingAngles(int[] angles)
angles - a pointer to an array of uint8_t angles with enough space for all servos. @see BLUESENSE_SERVOCONTROLLER_SERVOCOUNTpublic int getPendingAngle(int port)
port - one of the port pin values. @see bsServo_p1
public boolean getRequestSetAnglesDone()
public int getCurrentAngle(int port)
port - one of the port pin values. @see bsServo_p1
public void getCurrentAngles(int[] angleArray)
angleArray - a pointer to an array of uint8_t angles with enough space for all servos. @see BLUESENSE_SERVOCONTROLLER_SERVOCOUNTpublic void requestSetConfiguration(int offset)
offset - allows you to disposition the pwm duty cycle so as to fine tune the position of the servos.public void requestGetConfiguration()
public boolean getRequestSetConfigDone()
public boolean getRequestGetConfigDone()
public boolean configPending()
public int getCurrentOffset()
public long getTimeOutUs()
public void setTimeOutUs(int timeOutUs)
timeOutUs - the value in microseconds which is the maximum duraion between a request and its answer.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||