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:
- 93:837a13760026
- Parent:
- 92:b2f4ed4cb1e5
- Child:
- 94:0381e8b1beda
--- a/source/Main.cpp Tue May 02 09:55:55 2017 +0000
+++ b/source/Main.cpp Tue May 02 13:25:56 2017 +0000
@@ -7,6 +7,7 @@
Timer game_timer;
+
int main()
{
printf("start...\r\n");
@@ -68,11 +69,10 @@
case 15:
state = initialisation(); //init servo is included
- state = 103;
break;
case 16:
state = inital_arm_positioning();
-
+ state = 50;
break;
case 17:
state = initial_positioning();
@@ -125,30 +125,8 @@
case 50:
state = grabbing();
break;
- case 51:
- state = arm_position_move();
- break;
- case 52:
- arm_position_grabbing();
- state = 56;
- wait_ms(1000);
- break;
- case 53:
- state = arm_position_release();
- state = 55;
- wait_ms(1000);
- break;
- case 55:
- state = open_grabber();
- state = 52;
- wait_ms(1000);
- break;
- case 56:
- state = close_grabber();
- state = 53;
- wait_ms(1000);
- break;
+
/******************************************************************************/
//Testtools
@@ -168,34 +146,6 @@
printf("Color: %s\r\n",get_color()? str1 : str2);
wait_ms(500);
state = 101;
-
- case 102: //Testtool for grabbing functions
- arm_position_release();
- wait_ms(500);
- open_grabber();
- wait_ms(500);
- arm_position_grabbing();
- wait_ms(1000);
- move_for_distance(5.0);
- close_grabber();
- wait_ms(500);
- if (get_color() == 0) {
- open_grabber();
- move_for_distance(-5.0);
- }
- wait_ms(500);
- state = 102;
- break;
-
- case 103:
- move_for_distance(-1.00f);
- state = 104;
- break;
- case 104:
- if(move_for_distance(0) < 0.0f) {
- stop_move();
- state = 0;
- }
break;
}
}
