update
Dependencies: Stepper mbed SDFileSystem Ultrasonic PinDetect millis
Revision 9:f72ddee31041, committed 2019-01-18
- Comitter:
- rschimpf78
- Date:
- Fri Jan 18 19:40:19 2019 +0000
- Parent:
- 8:3f4d78017fd9
- Commit message:
- update
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 3f4d78017fd9 -r f72ddee31041 main.cpp --- a/main.cpp Fri Jan 18 00:22:13 2019 +0000 +++ b/main.cpp Fri Jan 18 19:40:19 2019 +0000 @@ -38,6 +38,7 @@ } else{ broken_switch = 0; + stop_error = 0; } } @@ -169,73 +170,76 @@ stop_error = 6; } - if (path_dist >= sens_pos-err && path_dist <= sens_pos+err){ //119 143 + else if (path_dist >= sens_pos-err && path_dist <= sens_pos+err){ //119 143 path_sheets = 16; } - if (path_dist >= sens_pos-err+sheet_th && path_dist <= sens_pos+err+sheet_th){ + else if (path_dist >= sens_pos-err+sheet_th && path_dist <= sens_pos+err+sheet_th){ path_sheets = 15; } - if (path_dist >= sens_pos-err+2*sheet_th && path_dist <= sens_pos+err+2*sheet_th){ //179-191 + else if (path_dist >= sens_pos-err+2*sheet_th && path_dist <= sens_pos+err+2*sheet_th){ //179-191 path_sheets = 14; } - if (path_dist >= sens_pos-err+3*sheet_th && path_dist <= sens_pos+err+3*sheet_th){ //205-217 + else if (path_dist >= sens_pos-err+3*sheet_th && path_dist <= sens_pos+err+3*sheet_th){ //205-217 path_sheets = 13; } - if (path_dist >= sens_pos-err+4*sheet_th && path_dist <= sens_pos+err+4*sheet_th){ //231-243 + else if (path_dist >= sens_pos-err+4*sheet_th && path_dist <= sens_pos+err+4*sheet_th){ //231-243 path_sheets = 12; } - if (path_dist >= sens_pos-err+5*sheet_th && path_dist <= sens_pos+err+5*sheet_th){ //257-269 + else if (path_dist >= sens_pos-err+5*sheet_th && path_dist <= sens_pos+err+5*sheet_th){ //257-269 path_sheets = 11; } - if (path_dist >= sens_pos-err+6*sheet_th && path_dist <= sens_pos+err+6*sheet_th){ //283-295 + else if (path_dist >= sens_pos-err+6*sheet_th && path_dist <= sens_pos+err+6*sheet_th){ //283-295 path_sheets = 10; } - if (path_dist >= sens_pos-err+7*sheet_th && path_dist <= sens_pos+err+7*sheet_th){ //309-321 + else if (path_dist >= sens_pos-err+7*sheet_th && path_dist <= sens_pos+err+7*sheet_th){ //309-321 path_sheets = 9; } - if (path_dist >= sens_pos-err+8*sheet_th && path_dist <= sens_pos+err+8*sheet_th){ //323-333 + else if (path_dist >= sens_pos-err+8*sheet_th && path_dist <= sens_pos+err+8*sheet_th){ //323-333 path_sheets = 8; } - if (path_dist >= sens_pos-err+9*sheet_th && path_dist <= sens_pos+err+9*sheet_th){ //349-359 + else if (path_dist >= sens_pos-err+9*sheet_th && path_dist <= sens_pos+err+9*sheet_th){ //349-359 path_sheets = 7; } - if (path_dist >= sens_pos-err+10*sheet_th && path_dist <= sens_pos+err+10*sheet_th){ + else if (path_dist >= sens_pos-err+10*sheet_th && path_dist <= sens_pos+err+10*sheet_th){ path_sheets = 6; } - if (path_dist >= sens_pos-err+11*sheet_th && path_dist <= sens_pos+err+11*sheet_th){ + else if (path_dist >= sens_pos-err+11*sheet_th && path_dist <= sens_pos+err+11*sheet_th){ path_sheets = 5; } - if (path_dist >= sens_pos-err+12*sheet_th && path_dist <= sens_pos+err+12*sheet_th){ + else if (path_dist >= sens_pos-err+12*sheet_th && path_dist <= sens_pos+err+12*sheet_th){ path_sheets = 4; } - if (path_dist >= sens_pos-err+13*sheet_th && path_dist <= sens_pos+err+13*sheet_th){ + else if (path_dist >= sens_pos-err+13*sheet_th && path_dist <= sens_pos+err+13*sheet_th){ path_sheets = 3; } - if (path_dist >= sens_pos-err+14*sheet_th && path_dist <= sens_pos+err+14*sheet_th){ + else if (path_dist >= sens_pos-err+14*sheet_th && path_dist <= sens_pos+err+14*sheet_th){ path_sheets = 2; } - if (path_dist >= sens_pos-10-err+15*sheet_th && path_dist <= sens_pos-10+err+15*sheet_th){ + else if (path_dist >= sens_pos-10-err+15*sheet_th && path_dist <= sens_pos-10+err+15*sheet_th){ path_sheets = 1; } - if (path_dist > sens_pos-err+16*sheet_th){ + else if (path_dist > sens_pos-err+16*sheet_th){ path_sheets = 0; } + else { + path_sheets = 17; + } } void retract()