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.
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
Generated on Fri Jul 22 2022 17:31:31 by
1.7.2