![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
für holdor
Fork of PES by
Diff: readCamera.cpp
- Revision:
- 23:6feed75772b6
- Parent:
- 22:ffd36f07c046
- Child:
- 24:be4fd3005611
diff -r ffd36f07c046 -r 6feed75772b6 readCamera.cpp --- a/readCamera.cpp Mon May 01 10:18:19 2017 +0000 +++ b/readCamera.cpp Mon May 01 12:35:14 2017 +0000 @@ -9,7 +9,7 @@ static int range = 1; // 1: fährt strahl an, 2: fährt kegel an static int state = 0; static double distance = 0; -static int yLimit = 40; +static int yLimit = 90; int j; uint16_t blocks; @@ -35,14 +35,17 @@ if(xAxis < 180 && xAxis > 140 && yAxis > 0 && yAxis < yLimit ) { // wenn Klotz an Position zum aufnehmen state = 400; range = 1; + printf("\n\raufnehmen\n\r"); } else { if (range == 1){ // fährt Strahl an if (xAxis < 140){ distance = ((xAxis - 160)*(-0.625))-1; state = 100 + (int) distance; + printf("\n\rfahre links\n\r"); } else if (xAxis > 180){ distance = ((xAxis - 160)*(0.625))-1; state = 200 + (int) distance; + printf("\n\rfahre rechts\n\r"); } else{ // fährt gerade distance = (((yAxis - yLimit)/(199-yLimit))*100); state = 300 + (int) distance; @@ -50,6 +53,7 @@ state=399; } range = 2; + printf("\n\rgerade\n\r"); } } else { // fährt solange bis Kegelrand if (xAxis > 185 || xAxis < 135) {