New project

Dependencies:   mbed TextLCD

Train.h

Committer:
jasminealice
Date:
2018-06-28
Revision:
31:9d973398554f
Parent:
29:6031227dcac9

File content as of revision 31:9d973398554f:

#ifndef TRAIN_H
#define TRAIN_H
#include "Track.h"


class Train : public Track
{
    public:
        Train(const unsigned int newaddress, const unsigned int newinst, int pos,const unsigned int speed, const unsigned int speed2);
        virtual ~Train();
        int getPosition();
        void sendCommand();
        void changeSpeed(unsigned int speed);
        void Stop();
        unsigned int getSpeed();
        bool checkInterupt(int pos);
        void setPosition(int pos);
        bool isClockwise();
        void changeDirection();
        bool checkStop();
        unsigned int normalSpeed();
        unsigned int slowlySpeed();
        

    protected:

    private:
    int nrPacket;
    int position;
    bool dirClockwise;
    bool isStopped;
    const unsigned int normSpeed;
    const unsigned int slowSpeed;
};

#endif // TRAIN_H