Jasmine Karlsson / Mbed 2 deprecated train_rail

Dependencies:   mbed TextLCD

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Train.h Source File

Train.h

00001 #ifndef TRAIN_H
00002 #define TRAIN_H
00003 #include "Track.h"
00004 
00005 
00006 class Train : public Track
00007 {
00008     public:
00009         Train(const unsigned int newaddress, const unsigned int newinst, int pos,const unsigned int speed, const unsigned int speed2);
00010         virtual ~Train();
00011         int getPosition();
00012         void sendCommand();
00013         void changeSpeed(unsigned int speed);
00014         void Stop();
00015         unsigned int getSpeed();
00016         bool checkInterupt(int pos);
00017         void setPosition(int pos);
00018         bool isClockwise();
00019         void changeDirection();
00020         bool checkStop();
00021         unsigned int normalSpeed();
00022         unsigned int slowlySpeed();
00023         
00024 
00025     protected:
00026 
00027     private:
00028     int nrPacket;
00029     int position;
00030     bool dirClockwise;
00031     bool isStopped;
00032     const unsigned int normSpeed;
00033     const unsigned int slowSpeed;
00034 };
00035 
00036 #endif // TRAIN_H