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 14:7e330f65f26e, committed 2017-04-19
- Comitter:
- itslinear
- Date:
- Wed Apr 19 16:27:30 2017 +0000
- Parent:
- 13:7eba9911e196
- Child:
- 15:7e9ecc4d7217
- Commit message:
- aktuell
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 Wed Apr 19 15:57:28 2017 +0000
+++ b/main.cpp Wed Apr 19 16:27:30 2017 +0000
@@ -48,7 +48,7 @@
while(1) {
-
+ int camValue = readCamera();
switch(state) {
@@ -61,13 +61,13 @@
break;
case 1:
- if(readCamera() == 1 || readCamera() == 2 || readCamera() == 3) { // Die Kamera erkennt ein grünen Klotz
+ if(camValue == 1 || camValue == 2 || camValue == 3) { // Die Kamera erkennt ein grünen Klotz
state = 4;
}
- if(readCamera() == 4) { // Roboter in Position
+ if(camValue == 4) { // Roboter in Position
state = 5;
}
- if(readCamera() == 0){
+ if(camValue == 0){
state = tempState;
}
@@ -109,15 +109,15 @@
case 4: // Roboter erkennt gründer Klotz, Klotz wird angefahren
roboter1.bandeAusweichen();
- if(readCamera() == 1) { // links fahren
+ if(camValue == 1) { // links fahren
pwmL = 0.45f;
pwmR = 0.45f;
}
- if(readCamera() == 2) { // rechts fahren
+ if(camValue == 2) { // rechts fahren
pwmL = 0.55f;
pwmR = 0.55f;
}
- if(readCamera() == 3) { // gerade fahren
+ if(camValue == 3) { // gerade fahren
pwmL = 0.55f;
pwmR = 0.45f;
}
--- a/readCamera.cpp Wed Apr 19 15:57:28 2017 +0000
+++ b/readCamera.cpp Wed Apr 19 16:27:30 2017 +0000
@@ -62,7 +62,7 @@
state = 0;
}
}
- printf("%d\n\r",state);
+ //printf("%d\n\r",state);
return state;
}
}
\ No newline at end of file
