Main Page | Class Hierarchy | Class List | Class Members

BlueSense::ServoDevice Class Reference

Inheritance diagram for BlueSense::ServoDevice:

BlueSense::Device List of all members.

Public Types

enum  PortEnum

Public Member Functions

 ServoDevice (Master master, ushort deviceId)
void requestSetAngles (byte relevantAngles, byte[] angles)
void requestSetAngle (PortEnum port, byte angle)
void requestGetAngles ()
void getPendingAngles (byte[] angles)
byte getPendingAngle (PortEnum port)
bool getRequestSetAnglesDone ()
byte getCurrentAngle (PortEnum port)
void getCurrentAngles (byte[] angleArray)
void requestSetConfiguration (byte offset)
void requestGetConfiguration ()
bool getRequestSetConfigDone ()
bool getRequestGetConfigDone ()
bool configPending ()
byte getCurrentOffset ()
uint getTimeOutUs ()
void setTimeOutUs (uint timeOutUs)

Static Public Attributes

static byte SERVOCOUNT = (byte)bluesense.BLUESENSE_SERVOCONTROLLER_SERVOCOUNT

Detailed Description

Interface to the Servo device BM7004.

The BM7004 can be used to control upto 8 servo motors. Via software you can control the angle.

Author:
Dinne Bosman


Member Enumeration Documentation

enum BlueSense::ServoDevice::PortEnum
 

Enum describing the servo motor output ports


Constructor & Destructor Documentation

BlueSense::ServoDevice::ServoDevice Master  master,
ushort  deviceId
[inline]
 

Creates a 'software' servo device proxy with a given id. The device will inacessible until a physical device with the same id is detected.

Parameters:
master 
deviceId 


Member Function Documentation

bool BlueSense::ServoDevice::configPending  )  [inline]
 

Checks if a configuration is being currently being set or being retrieved

Returns:
true if busy, false if done

byte BlueSense::ServoDevice::getCurrentAngle PortEnum  port  )  [inline]
 

Returns the current set angle of a specific servo.

Parameters:
port the port pin of the servo. Must lie between 0 and BLUESENSE_SERVOCONTROLLER_SERVOCOUNT.
See also:
PortEnum
Returns:
the angle of the servo.

void BlueSense::ServoDevice::getCurrentAngles byte[]  angleArray  )  [inline]
 

Fills an array with the current set angles.

Parameters:
angleArray a pointer to an array of uint8_t angles with enough space for all servos.
See also:
SERVOCOUNT

byte BlueSense::ServoDevice::getCurrentOffset  )  [inline]
 

Returns the current set offset configuration parameter

Returns:
The offset. The offset allows you to disposition the pwm duty cycle so as to fine tune the position of the servos.

byte BlueSense::ServoDevice::getPendingAngle PortEnum  port  )  [inline]
 

Returns the angle of a specific servo, which is currently underway to the device

Parameters:
port the output port.
See also:
PortEnum
Returns:
the angle to be set on the servo.

void BlueSense::ServoDevice::getPendingAngles byte[]  angles  )  [inline]
 

Fills an array with angles which are currently underway to the device

Parameters:
angles a pointer to an array of uint8_t angles with enough space for all servos.
See also:
SERVOCOUNT

bool BlueSense::ServoDevice::getRequestGetConfigDone  )  [inline]
 

Checks if the configuration request is finished

Returns:
true if configuration was retrieved, false if still busy

bool BlueSense::ServoDevice::getRequestSetAnglesDone  )  [inline]
 

Checks if the angle set request is finished

Returns:
true if request finished, false if request still busy

bool BlueSense::ServoDevice::getRequestSetConfigDone  )  [inline]
 

Checks if the configuration set request is finished

Returns:
true if request finished, false if request still busy

uint BlueSense::ServoDevice::getTimeOutUs  )  [inline]
 

Returns the current set time out delay. The time out delay is used to check if a request was acknowledged in the set time. If an answer to a request is not received within the set time, the request is resent.

Returns:
the time out value in microseconds.

void BlueSense::ServoDevice::requestGetAngles  )  [inline]
 

Sends a request to retrieve the current set angles

void BlueSense::ServoDevice::requestGetConfiguration  )  [inline]
 

Request to obtain the configuration settings from a adcInput Device.

void BlueSense::ServoDevice::requestSetAngle PortEnum  port,
byte  angle
[inline]
 

Requests the servo device to set one of its servos to a new angle

Parameters:
port the output port.
See also:
PortEnum
Parameters:
angle 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.

void BlueSense::ServoDevice::requestSetAngles byte  relevantAngles,
byte[]  angles
[inline]
 

Requests the servo device to set its servos to new angles

Parameters:
relevantAngles a bit mask indicating which servos to update
angles a pointer to an array of uint8_t angles with enough space for all servos.
See also:
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.

void BlueSense::ServoDevice::requestSetConfiguration byte  offset  )  [inline]
 

Requests to set the configuration of a servo device.

Parameters:
offset allows you to disposition the pwm duty cycle so as to fine tune the position of the servos.

void BlueSense::ServoDevice::setTimeOutUs uint  timeOutUs  )  [inline]
 

Sets the time out value which is used to check if a request was acknowledged in the set time. If an answer to a request is not received within the set time, the request is resent.

Parameters:
timeOutUs the value in microseconds which is the maximum duraion between a request and its answer.


Member Data Documentation

byte BlueSense::ServoDevice::SERVOCOUNT = (byte)bluesense.BLUESENSE_SERVOCONTROLLER_SERVOCOUNT [static]
 

The number of servos that can be controlled


The documentation for this class was generated from the following file:
Generated on Mon Jan 21 17:51:58 2008 for BlueSense.NET/Mono by  doxygen 1.4.4