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.
HW05Code/Car.h@0:f17da79e74c9, 2019-10-09 (annotated)
- Committer:
- MannyK
- Date:
- Wed Oct 09 16:29:06 2019 +0000
- Revision:
- 0:f17da79e74c9
For Evans
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| MannyK | 0:f17da79e74c9 | 1 | #ifndef _CAR_H_ |
| MannyK | 0:f17da79e74c9 | 2 | #define _CAR_H_ |
| MannyK | 0:f17da79e74c9 | 3 | |
| MannyK | 0:f17da79e74c9 | 4 | #include "Road.h" |
| MannyK | 0:f17da79e74c9 | 5 | #include "mbed.h" |
| MannyK | 0:f17da79e74c9 | 6 | |
| MannyK | 0:f17da79e74c9 | 7 | class Road; |
| MannyK | 0:f17da79e74c9 | 8 | |
| MannyK | 0:f17da79e74c9 | 9 | class Car { |
| MannyK | 0:f17da79e74c9 | 10 | public: |
| MannyK | 0:f17da79e74c9 | 11 | int position; |
| MannyK | 0:f17da79e74c9 | 12 | int speed; |
| MannyK | 0:f17da79e74c9 | 13 | int flag; |
| MannyK | 0:f17da79e74c9 | 14 | |
| MannyK | 0:f17da79e74c9 | 15 | Car(int id, Road* road, int flag); |
| MannyK | 0:f17da79e74c9 | 16 | void update(); |
| MannyK | 0:f17da79e74c9 | 17 | void reset(int position, int speed); |
| MannyK | 0:f17da79e74c9 | 18 | void stop(); |
| MannyK | 0:f17da79e74c9 | 19 | |
| MannyK | 0:f17da79e74c9 | 20 | protected: |
| MannyK | 0:f17da79e74c9 | 21 | int id; |
| MannyK | 0:f17da79e74c9 | 22 | int cycle; |
| MannyK | 0:f17da79e74c9 | 23 | Road* road; |
| MannyK | 0:f17da79e74c9 | 24 | Thread* thread; |
| MannyK | 0:f17da79e74c9 | 25 | }; |
| MannyK | 0:f17da79e74c9 | 26 | #endif |