ft. button press reset
Dependencies: mbed
Fork of BeaconDemo_RobotCodeNew by
Diff: main.cpp
- Revision:
- 21:efe191c96cbb
- Parent:
- 20:fe7eb85cf3a1
- Child:
- 22:3643fc1c82b6
diff -r fe7eb85cf3a1 -r efe191c96cbb main.cpp --- a/main.cpp Thu Mar 02 13:54:12 2017 +0000 +++ b/main.cpp Mon Mar 06 13:52:55 2017 +0000 @@ -77,8 +77,6 @@ if(use_recharging_program == 1)recharging_program(); update_display(); if(recharging_state == 0) { - // remove after testing - //main_program_state = 8; switch(main_program_state) { case 0: //Case 0 is the initial program: turn to face beacon if(step_cycle == 0) { @@ -142,12 +140,12 @@ wait(0.8); display.clear_display(); display.set_position(0,0); - display.write_string("BEAUTIFUL MEME"); + display.write_string("SCI MUSEUM"); display.set_position(1,0); display.write_string(" PROJECT"); wait(0.2); out("------------------------------------------------------\n"); - out("Beautiful Meme Project Demo Code \n"); + out("Dank Meme Project Demo Code \n"); out("------------------------------------------------------\n"); locate_beacon(); while(beacon_found == 0) { @@ -237,51 +235,49 @@ display.clear_display(); display.set_position(0,0); - display.write_string(buffer); + //display.write_string(buffer); //"A" = 0x41 if(buffer[0] == 'A'){ -/* display.clear_display(); - display.set_position(0,0); - display.write_string("Gotcha!");*/ - - //set_program(255); // STOP + main_program_state = 255; + display.write_string("MALLARD QUACK QUACK"); } //"B" = 0x42 else if(buffer[0] == 'B'){ - //set_program(1); // Head to beacon + //set_program(1); main_program_state = 1; + display.write_string("LAPS (BEACON)"); } //"C" = 0x43 else if(buffer[0] == 'C'){ - //set_program(2); // Head to beacon + 180 main_program_state = 2; + display.write_string("LAPS (SOUTH)"); } //"D" = 0x44 else if(buffer[0] == 'D'){ - //set_program(8); // Flocking main_program_state = 8; + display.write_string("FLOCKING"); } else if(buffer[0] == 'E'){ - //set_program(4); // Random Walk main_program_state = 4; + display.write_string("RANDOM WALK"); } else if(buffer[0] == 'F'){ - //set_program(6); // Aggregation main_program_state = 6; + display.write_string("AGGREGATION"); } else if(buffer[0] == 'G'){ - //set_program(5); // Find Space main_program_state = 5; + display.write_string("FIND SPACE"); } else if(buffer[0] == 'H'){ - //set_program(6); // Clustering main_program_state = 6; + display.write_string("CLUSTERING"); } else if(buffer[0] == 'I'){ - //set_program(7); // Tag main_program_state = 7; + display.write_string("TAG"); } else { @@ -294,24 +290,9 @@ ///init() in psiswarm.cpp sets up the robot init(); user_code_setup(); - //char prog_index; - //char * p_index = &prog_index; user_code_running = 1; while(1) { -/* prog_index = pc.getc(); - switch(prog_index){ - case 0x61: - display.clear_display(); - display.set_position(0,0); - display.write_string("Facing Beacon"); - break; - default: - display.clear_display(); - display.set_position(0,0); - display.write_string(p_index); - pc.putc(prog_index); - break; - }*/ + wait(1); } }