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.
Diff: main.cpp
- Revision:
- 67:7ff2425141ce
- Parent:
- 66:45a90a945983
- Child:
- 68:9859a3ff9298
--- a/main.cpp Tue Jun 26 12:16:39 2018 +0000 +++ b/main.cpp Tue Jun 26 12:56:54 2018 +0000 @@ -828,18 +828,18 @@ lcd.printf("NAC Both area A or B"); NAC = true; } - }else if((DR_train.get_position_number() == D11) && (LR_train.get_position_number() == D5 )){ //Check if they are in position D11 and D5 + }else if(((DR_train.get_position_number() == D11) && (LR_train.get_position_number() == D5 ) ) || ((LR_train.get_position_number() == D5) && (DR_train.get_position_number() == D11 ))){ //Check if they are in position D11 and D5 if(!(DR_train.goes_cw() ^ LR_train.goes_cw())){ // NOT XOR: They must have same values to be true (Same direction) lcd.cls(); - lcd.printf("NAC DR D11 and LR D5"); + lcd.printf("NAC D11 and D5"); NAC = true; } - }else if((DR_train.get_position_number() == D9) && (LR_train.get_position_number() == D3 )){//Check if they are in position D9 and D3 + }else if(((DR_train.get_position_number() == D9) && (LR_train.get_position_number() == D3)) || ((LR_train.get_position_number() == D9) && (DR_train.get_position_number() == D3)) ){//Check if they are in position D9 and D3 if(!(DR_train.goes_cw() ^ LR_train.goes_cw())){ // NOT XOR: They must have same values to be true (Same direction) lcd.cls(); - lcd.printf("NAC DR D9 and LR D3"); + lcd.printf("NAC D9 and D3"); NAC = true; } }