Class Bertl added

Dependencies:   HCSR

Dependents:   BertlDrive_V2 BertlDrive_V2

Committer:
bulmecisco
Date:
Fri Apr 17 06:59:34 2015 +0000
Revision:
8:07e55b300ff1
Child:
12:cedc088eaf05
Robot class added for objectBertl simulation program compatibility; You can use KPP-Files with some additions - see Robot.cpp

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bulmecisco 8:07e55b300ff1 1 /***********************************
bulmecisco 8:07e55b300ff1 2 name: Robot.h Version: 0.1
bulmecisco 8:07e55b300ff1 3 author: PE HTL BULME
bulmecisco 8:07e55b300ff1 4 email: pe@bulme.at
bulmecisco 8:07e55b300ff1 5 WIKI: https://developer.mbed.org/teams/BERTL_CHEL_18/code/ur_Bertl/
bulmecisco 8:07e55b300ff1 6 description:
bulmecisco 8:07e55b300ff1 7 Definition portion of a new Robot class for objectivRobot
bulmecisco 8:07e55b300ff1 8
bulmecisco 8:07e55b300ff1 9 ***********************************/
bulmecisco 8:07e55b300ff1 10 #include "mbed.h"
bulmecisco 8:07e55b300ff1 11 #include "ur_Bertl.h"
bulmecisco 8:07e55b300ff1 12 #include "string"
bulmecisco 8:07e55b300ff1 13
bulmecisco 8:07e55b300ff1 14 #ifndef ROBOT_H
bulmecisco 8:07e55b300ff1 15 #define ROBOT_H
bulmecisco 8:07e55b300ff1 16
bulmecisco 8:07e55b300ff1 17 class Robot : public ur_Bertl
bulmecisco 8:07e55b300ff1 18 {
bulmecisco 8:07e55b300ff1 19 public:
bulmecisco 8:07e55b300ff1 20 Robot() {};
bulmecisco 8:07e55b300ff1 21 Robot(int x, int y, int dir, int beeper) {}
bulmecisco 8:07e55b300ff1 22 void move(); // nur Deklaration - Prototyping
bulmecisco 8:07e55b300ff1 23 void turnLeft();
bulmecisco 8:07e55b300ff1 24 bool frontIsClear();
bulmecisco 8:07e55b300ff1 25 void pickBeeper();
bulmecisco 8:07e55b300ff1 26 void putBeeper();
bulmecisco 8:07e55b300ff1 27 bool nextToABeeper(); //is there one or more beepers in the same corner?
bulmecisco 8:07e55b300ff1 28 bool nextToARobot(); //is there another robot in the corner?
bulmecisco 8:07e55b300ff1 29 bool facingNorth(); //is the robot facing North?
bulmecisco 8:07e55b300ff1 30 bool facingSouth(); // is the robot facing South?
bulmecisco 8:07e55b300ff1 31 bool facingEast(); // is the robot facing East?
bulmecisco 8:07e55b300ff1 32 bool facingWest(); // is the robot facing West?
bulmecisco 8:07e55b300ff1 33 bool anyBeepersInBeeperBag(); //are there any beepers in the bag?
bulmecisco 8:07e55b300ff1 34 };
bulmecisco 8:07e55b300ff1 35 #endif