Initial Commit
Dependencies: mbed HC05 QEI MODSERIAL SWSPI mbed-rtos
Diff: shell/bt_shell.cpp
- Revision:
- 4:81b0de07841f
- Parent:
- 3:d1197b5ea68a
--- a/shell/bt_shell.cpp Sun Oct 12 23:27:43 2014 +0000 +++ b/shell/bt_shell.cpp Tue Oct 14 17:55:37 2014 +0000 @@ -56,7 +56,7 @@ linear_velocity_direction= buffer[2]; rotational_velocity_value = buffer[3]<<8|buffer[4]; rotational_velocity_direction= buffer[5]; - + if( linear_velocity_direction==0x01) { linear_velocity_value=linear_velocity_value; linear_velocity_value=linear_velocity_value; @@ -79,11 +79,31 @@ } else if(buffer[0] == 'P' && buffer[1]== 'O') { software_interuupt=1; myreset=0; - } + } else if(buffer[3] == 'E') { + bt.printf(">>1B"); + bt.gets(buffer, 5); + if (buffer[3] =='O') { + bt.gets(buffer, 2); + bt_connected=true; + if(buffer[0]=='A') { + Selected_robot='A'; + imperial_march(); + } else if(buffer[0]=='F') { + Selected_robot='F'; + Led_on(); + } + } + } else if(buffer[3] == '?') { + bt.printf("eBot#2"); + } + else if(buffer[3] == 'X') { // Harsh please send <<1X when you are disconnecting + bt_connected=false; // from Amigobot it will realise the connection is stooped + } else { bt.rxBufferFlush(); } } bt.unlock(); - print_all(); + if(bt_connected) + print_all(); } \ No newline at end of file