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.
Dependencies: mbed
Fork of Robocode by
Diff: source/Main.cpp
- Revision:
- 79:92b9d083322d
- Parent:
- 78:d9138c6f82a8
- Child:
- 80:956f65714207
--- a/source/Main.cpp Tue Apr 25 11:42:45 2017 +0000
+++ b/source/Main.cpp Wed Apr 26 07:30:03 2017 +0000
@@ -1,14 +1,12 @@
#include "Main.h"
-int state = 10;
+int state = 15;
bool positioning_state = 0;
bool mapping_state = 0;
Timer game_timer;
-int IMU();
-
int main()
{
printf("start...\r\n");
@@ -69,12 +67,13 @@
case 15:
state = initialisation(); //init servo is included
+ state = 100;
break;
case 16:
- state = initial_positioning();
+ state = inital_arm_positioning();
break;
case 17:
- state = inital_arm_positioning();
+ state = initial_positioning();
break;
case 25:
@@ -152,6 +151,15 @@
state = 53;
wait_ms(1000);
break;
+ case 100:
+ printf("sensor 0: %f \r\n", getDistanceIR(0));
+ printf("sensor 1: %f \r\n", getDistanceIR(1));
+ printf("sensor 2: %f \r\n", getDistanceIR(2));
+ printf("sensor 3: %f \r\n", getDistanceIR(3));
+ printf("sensor 4: %f \r\n", getDistanceIR(4));
+ printf("sensor 5: %f \r\n\n", getDistanceIR(5));
+ state = 100;
+ break;
}
}
}
\ No newline at end of file
