Main Page | Class List | File List | Class Members

Lego::LegoRobo Class Reference

Class to set up the Lego Tower and then use it to control the motor. More...

#include <lego.hxx>

List of all members.

Public Member Functions

 LegoRobo ()
 ~LegoRobo ()
int cheackalive ()
int setdirection (char motors, char flip, char setforward)
int setonoff (char motors, char on_off)
int setpower (char motors, char ptype, char level)


Detailed Description

Class to set up the Lego Tower and then use it to control the motor.

The member functions may block if the corresponding command blocks


Constructor & Destructor Documentation

Lego::LegoRobo::LegoRobo  ) 
 

Default contructor

Lego::LegoRobo::~LegoRobo  ) 
 

Default destructor


Member Function Documentation

int Lego::LegoRobo::cheackalive  ) 
 

Function to check the status of link

Returns:
: 1 if successful else 0

int Lego::LegoRobo::setdirection char  motors,
char  flip,
char  setforward
 

Function to send direction commnads for the motor

Parameters:
motors: Indicate the motors to be targetted
flip: flip the direction of the specified motors
setforward: set the direction of motor to forward
Returns:
: 1 if successful else 0 If the flip and setforward are both 0 then the directions are set to resverse and if both 1 then the direction is flipped.

int Lego::LegoRobo::setonoff char  motors,
char  on_off
 

Function to set the motors on/off

Parameters:
motors: The motors to be targetted
on_off: Action to be taken If on_off is 'LEGO_MOTOR_ON | LEGO_MOTOR_OFF' then the motors are turned on If its !(LEGO_MOTOR_ON | LEGO_MOTOR_OFF) then the motors are set to spin freely

int Lego::LegoRobo::setpower char  motors,
char  ptype,
char  level
 

Function to set the motors on/off

Parameters:
motors: The motors to be targetted
ptype: selected source of power
level: selected level of power


The documentation for this class was generated from the following file:
Generated on Sun Oct 31 09:07:02 2004 for LegoRobo by doxygen 1.3.4