Main Page | Class Hierarchy | Class List | Class Members

BlueSense::MotorDevice Class Reference

Inheritance diagram for BlueSense::MotorDevice:

BlueSense::Device List of all members.

Public Types

enum  PortEnum

Public Member Functions

 MotorDevice (Master master, ushort deviceId)
void requestSetSpeeds (byte relevantSpeeds, char[] speeds)
void requestSetSpeed (PortEnum port, char speed)
void requestGetSpeeds ()
void getPendingSpeeds (char[] speeds)
char getPendingSpeed (PortEnum port)
bool getRequestSetSpeedsDone ()
char getCurrentSpeed (PortEnum port)
void getCurrentSpeeds (char[] speedArray)
uint getTimeOutUs ()
void setTimeOutUs (uint timeOutUs)

Static Public Attributes

static byte MOTORCOUNT = (byte)bluesense.BLUESENSE_MOTORCONTROLLER_MOTORCOUNT

Detailed Description

Interface to the Motor device BM7005.

The BM7005 can be used to control 2 DC motors. Via software you can control the speed.

Author:
Dinne Bosman


Member Enumeration Documentation

enum BlueSense::MotorDevice::PortEnum
 

Enum describing the dc motor output ports


Constructor & Destructor Documentation

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

Creates a 'software' motor 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

char BlueSense::MotorDevice::getCurrentSpeed PortEnum  port  )  [inline]
 

Returns the current set speed of a specific motor.

Parameters:
port the index of the motor. Must lie between 0 and BLUESENSE_MOTORCONTROLLER_MOTORCOUNT.
See also:
PortEnum
Returns:
the speed off the motor. Note that speed is a value between -128 and 127. -128 to -1 represent a speed left, 0 stand still and 1 to 127 a speed right, the actual physical speed depends on the specifications of the connected motor.

void BlueSense::MotorDevice::getCurrentSpeeds char[]  speedArray  )  [inline]
 

Fills an array with the current set speeds.

Parameters:
speedArray a pointer to an array of speeds with enough space for all motors.
See also:
MOTORCOUNT Note that each speed is a value between -128 and 127. -128 to -1 represent a speed left, 0 stand still and 1 to 127 a speed right, the actual physical speed depends on the specifications of the connected motor.

char BlueSense::MotorDevice::getPendingSpeed PortEnum  port  )  [inline]
 

Returns the speed of a specific motor, which is currently underway to the device

Parameters:
port the output port.
See also:
PortEnum
Returns:
the speed to be set on the motor. Note that speed is a value between -128 and 127. -128 to -1 represent a speed left, 0 stand still and 1 to 127 a speed right, the actual physical speed depends on the specifications of the connected motor.

void BlueSense::MotorDevice::getPendingSpeeds char[]  speeds  )  [inline]
 

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

Parameters:
speeds a pointer to an array of uint8_t speeds with enough space for all motors.
See also:
BLUESENSE_MOTORCONTROLLER_MOTORCOUNT Note that each speed is a value between -128 and 127. -128 to -1 represent a speed left, 0 stand still and 1 to 127 a speed right, the actual physical speed depends on the specifications of the connected motor.

bool BlueSense::MotorDevice::getRequestSetSpeedsDone  )  [inline]
 

Checks if the speed set request is finished

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

uint BlueSense::MotorDevice::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::MotorDevice::requestGetSpeeds  )  [inline]
 

Sends a request to retrieve the current set speeds

void BlueSense::MotorDevice::requestSetSpeed PortEnum  port,
char  speed
[inline]
 

Requests the motor device to set one of its motors to a new speed

Parameters:
port the output port.
See also:
PortEnum
Parameters:
speed an uint8_t representing the new speed of the motor. Note that each speed is a value between -128 and 127. -128 to -1 represent a speed left, 0 stand still and 1 to 127 a speed right, the actual physical speed depends on the specifications of the connected motor.

void BlueSense::MotorDevice::requestSetSpeeds byte  relevantSpeeds,
char[]  speeds
[inline]
 

Requests the motor device to set its motors to new speeds

Parameters:
relevantSpeeds a bit mask indicating which motors to update
speeds a pointer to an array of uint8_t speeds with enough space for all motors.
See also:
MOTORCOUNT Note that each speed is a value between -128 and 127. -128 to -1 represent a speed left, 0 stand still and 1 to 127 a speed right, the actual physical speed depends on the specifications of the connected motor.

void BlueSense::MotorDevice::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::MotorDevice::MOTORCOUNT = (byte)bluesense.BLUESENSE_MOTORCONTROLLER_MOTORCOUNT [static]
 

The number of motors 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