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.
Fork of PES by
Revision 18:ea4671f566d4, committed 2017-04-25
- Comitter:
- Shukle
- Date:
- Tue Apr 25 13:44:12 2017 +0000
- Parent:
- 17:caf5ae550f2e
- Child:
- 19:2f44ecffaf30
- Commit message:
- anfahren funktioniert
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| readCamera.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Apr 25 12:26:04 2017 +0000
+++ b/main.cpp Tue Apr 25 13:44:12 2017 +0000
@@ -74,7 +74,7 @@
case 2:
printf("2");
- if(time1 < 20) { // Im Kreis drehen für 1s
+ if(time1 < 15) { // Im Kreis drehen für 1s
pwmL = 0.4f;
pwmR = 0.4f;
time1 ++;
@@ -92,7 +92,7 @@
case 3:
printf("3");
roboter1.bandeAusweichen();
- if(time2 < 40) { // gerade aus fahren
+ if(time2 < 100) { // gerade aus fahren
pwmL = 0.6f;
pwmR = 0.4f;
time2 ++;
@@ -111,16 +111,19 @@
printf("4");
roboter1.bandeAusweichen();
if(camValue == 1) { // links fahren
- pwmL = 0.45f;
- pwmR = 0.45f;
+ printf(".1;");
+ pwmL = 0.425f;
+ pwmR = 0.425f;
}
if(camValue == 2) { // rechts fahren
- pwmL = 0.55f;
- pwmR = 0.55f;
+ printf(".2;");
+ pwmL = 0.575f;
+ pwmR = 0.575f;
}
if(camValue == 3) { // gerade fahren
- pwmL = 0.55f;
- pwmR = 0.45f;
+ printf(".3;");
+ pwmL = 0.6f;
+ pwmR = 0.4f;
}
state = 1;
--- a/readCamera.cpp Tue Apr 25 12:26:04 2017 +0000
+++ b/readCamera.cpp Tue Apr 25 13:44:12 2017 +0000
@@ -29,14 +29,14 @@
// soll drehen bis in stahl, fahren bis kegel, 25 pixel links rechts kegel
- if(xAxis < 185 && xAxis > 135 && yAxis > 155 && yAxis < 190 ) { // wenn Klotz an Position zum aufnehmen
+ if(xAxis < 200 && xAxis > 120 && yAxis > 155 && yAxis < 190 ) { // wenn Klotz an Position zum aufnehmen
state = 4;
range = 1;
} else {
if (range == 1){ // fährt Strahl an
- if (xAxis < 155){
+ if (xAxis < 140){
state = 1;
- } else if (xAxis > 165){
+ } else if (xAxis > 180){
state = 2;
} else{ // fährt gerade
state = 3;
