Clemson ECE 453
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Rover Group and Sensor Group API and Stub code

Go down

Rover Group and Sensor Group API and Stub code Empty Rover Group and Sensor Group API and Stub code

Post  dsmarsh Tue Feb 03, 2009 2:13 pm

--This is the API for the Rover Group--
Code:
// ECE 453 - Spring 2009
// Communication group
// Rover API
// Describes the application programming interface between the communication
// group and rover movement applications.


//This is the API the rover is using since it will be all in the same header file.
//We just call the functions

//Moves forward at a constant speed, one tick.
//Returns true if command was executed
bool moveForward();

//Moves backwards at a constant speed, one tick.
//Returns true if command was executed
bool moveBackward();

//Turns left at a constant speed, one tick.
//Returns true if command was executed
bool turnLeft();

//Turns right at a constant speed, one tick.
//Returns true if command was executed
bool turnRight();


--This is the stub code for the Rover Group--
Code:
This is our stub code for their header file-

//This is the stub code for the rover group’s functions

//Moves forward at a constant speed, one tick.
//Returns true if command was executed
bool moveForward()
{
  printf(“Rover moved forward one tick\n”);
  return true;
}

//Moves backwards at a constant speed, one tick.
//Returns true if command was executed
bool moveBackward()
{
  printf(“Rover moved backward one tick\n”);
  return true;
}

//Turns left at a constant speed, one tick.
//Returns true if command was executed
bool turnLeft()
{
  printf(“Rover turned left one tick\n”);
  return true;
}

//Turns right at a constant speed, one tick.
//Returns true if command was executed
bool turnRight()
{
  printf(“Rover turned right one tick\n”);
  return true;
}
dsmarsh
dsmarsh

Posts : 54
Join date : 2009-01-08
Age : 38

Back to top Go down

Rover Group and Sensor Group API and Stub code Empty Re: Rover Group and Sensor Group API and Stub code

Post  dsmarsh Tue Feb 03, 2009 7:06 pm

--This is the API for the Sensor Group--

Code:
// ECE 453 - Spring 2009
// Communication group
// Rover API
// Describes the application programming interface between the communication
// group and rover movement applications.

//the Sensor group calls this function when there is a hit registered on either robot
//dead == true when robot was hit
void RoverDead(bool dead);


There is not stub code since we will be writing this code ourselves.
dsmarsh
dsmarsh

Posts : 54
Join date : 2009-01-08
Age : 38

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum