Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: BertlDrive_V2 BertlDrive_V2
Robot.h@12:cedc088eaf05, 2015-04-26 (annotated)
- Committer:
- bulmecisco
- Date:
- Sun Apr 26 20:04:47 2015 +0000
- Revision:
- 12:cedc088eaf05
- Parent:
- 8:07e55b300ff1
Class Bertl with additional Methodes added
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| bulmecisco | 8:07e55b300ff1 | 1 | /*********************************** |
| bulmecisco | 12:cedc088eaf05 | 2 | name: Robot.h Version: 1.0 |
| 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 |