VAM
Dependencies: Stepper mbed HCSR04 millis
Diff: main.cpp
- Revision:
- 4:1a4022b21dae
- Parent:
- 3:fd2ca631ab44
- Child:
- 5:e958d61e0564
--- a/main.cpp Sat Oct 13 02:19:16 2018 +0000 +++ b/main.cpp Fri Nov 16 20:17:04 2018 +0000 @@ -19,7 +19,7 @@ { unsigned int dist; int er = 5; - int fp = 448; //adjust if needed + int fp = 457; //adjust if needed int lp = 64; //adjust if needed int tp = 25; @@ -123,8 +123,8 @@ { unsigned int path_dist; - int err = 8; - int sens_pos = 148; //adjust if needed //535 0 plates + int err = 11; + int sens_pos = 126; //adjust if needed //535 0 plates int sheet_th = 25; pathsensor.start(); wait_ms(500); @@ -132,7 +132,7 @@ pc.printf("\nBeam Path Sensor : %ld",path_dist); path_sheets = 17; - if (path_dist >= sens_pos-err && path_dist <= sens_pos+err){ //127,143 a:152 + if (path_dist >= sens_pos-err && path_dist <= sens_pos+err){ //110,130 path_sheets = 16; } @@ -192,11 +192,11 @@ path_sheets = 2; } - if (path_dist >= sens_pos-err+15*sheet_th && path_dist <= sens_pos+err+15*sheet_th){ + if (path_dist >= sens_pos-10-err+15*sheet_th && path_dist <= sens_pos-10+err+15*sheet_th){//greater than 509 less 517 path_sheets = 1; } - if (path_dist > sens_pos-err+16*sheet_th){ + if (path_dist > sens_pos-err+16*sheet_th){ //greater than 534 path_sheets = 0; } }