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:
- 53:1ffd622bab24
- Parent:
- 52:c08495446f87
- Child:
- 54:fbec50ae6fb6
--- a/main.cpp Wed Jun 20 12:54:28 2018 +0000 +++ b/main.cpp Wed Jun 20 13:05:42 2018 +0000 @@ -618,33 +618,33 @@ LR_dir = "cw"; }else{ LR_dir = "ccw"; - } + } - lcd.cls(); - lcd.printf("S:D%d DR%d(",sensor,DR_train.get_position_number()); - - //TODO: Do a for to print all next sensors. - for(int i=0; i<DR_train.get_next_sensors().size(); i++){ - - lcd.printf("%d,",DR_train.get_next_sensors()[i]); - } - - lcd.printf(")%s LR%d(",DR_dir,LR_train.get_position_number()); - - for(int i=0; i<LR_train.get_next_sensors().size(); i++){ - - lcd.printf("%d,",LR_train.get_next_sensors()[i]); - } - - lcd.printf(")%s",LR_dir); //wait(0.7); if(sensor == DR_train.get_position_number()){ - led2 = 0; - //lcd.cls(); - //lcd.printf("Sensor TWICE!!"); + led2 = 0; }else{ + + lcd.cls(); + lcd.printf("S:D%d DR%d(",sensor,DR_train.get_position_number()); + + //TODO: Do a for to print all next sensors. + for(int i=0; i<DR_train.get_next_sensors().size(); i++){ + + lcd.printf("%d,",DR_train.get_next_sensors()[i]); + } + + lcd.printf(")%s LR%d(",DR_dir,LR_train.get_position_number()); + + for(int i=0; i<LR_train.get_next_sensors().size(); i++){ + + lcd.printf("%d,",LR_train.get_next_sensors()[i]); + } + + lcd.printf(")%s",LR_dir); + //Checking next sensors for DR train for(int i=0; i<DR_train.get_next_sensors().size(); i++){ @@ -698,7 +698,7 @@ - /* + if(found_DR){ //doBuzz(); @@ -717,7 +717,7 @@ lcd.cls(); lcd.printf("No train before :("); } - */ + }