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
source/StartUp.cpp
- Committer:
- aeschsim
- Date:
- 2017-05-01
- Revision:
- 81:a6f0f827dcb0
- Parent:
- 79:92b9d083322d
- Child:
- 87:df8c869a5a52
File content as of revision 81:a6f0f827dcb0:
#include "StartUp.h"
bool stb = false;
bool stb2 = false;
bool stb3 = false;
int idle()
{
if(get_user() == false && stb) {
return 15; // button pressed
} else {
stb = true;
return 10;
}
}
int idle2()
{
if(get_user() == false && stb2) {
return 102;
} else {
stb2 = true;
wait_ms(100);
return 11;
}
}
int initialisation()
{
Robot_init_all();
return 16;
}
int inital_arm_positioning(){
open_grabber();
arm_position_release();
return 17;
}
int initial_turn()
{
if(stb3 == false) {
stb3 = true;
printf("initial turn...\r\n");
turn_for_deg(180);
} else {
printf("turning...\r\n");
if(1) { // check if turning complete
printf("turn finished...\r\n");
return 35;
}
}
return 28;
}
