Jasmine Karlsson
/
train_rail
New project
Diff: Train.cpp
- Revision:
- 20:32ba0a5f2d02
- Parent:
- 18:f5824ba95892
- Child:
- 21:31647d80614f
--- a/Train.cpp Mon Jun 11 10:55:45 2018 +0000 +++ b/Train.cpp Mon Jun 11 14:50:15 2018 +0000 @@ -1,9 +1,10 @@ #include "Train.h" -Train::Train(unsigned int newaddress) +Train::Train(const unsigned int newaddress, const unsigned int newinst) { //ctor address = newaddress; + inst = newinst; position = -1; direction = true; } @@ -17,3 +18,15 @@ return position; } + +void Train::goForward(unsigned int forward){ + + inst = forward; + DCC_send_command(address, inst, nrPacket); + +} + +void Train::Stop(unsigned int stop){ + stop = 0x40; + DCC_send_command(address, stop, nrPacket); +} \ No newline at end of file