Initial Commit
Revision 3:3e3314102e56, committed 2014-10-12
- Comitter:
- Throwbot
- Date:
- Sun Oct 12 23:27:33 2014 +0000
- Parent:
- 2:37a19a9e5f2c
- Child:
- 4:0eeea5f05e28
- Commit message:
- Ebot demo working
Changed in this revision
robot.cpp | Show annotated file Show diff for this revision Revisions of this file |
robot.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/robot.cpp Sun Oct 12 13:33:06 2014 +0000 +++ b/robot.cpp Sun Oct 12 23:27:33 2014 +0000 @@ -71,6 +71,8 @@ int Encoder_y=0; int dtheta=0; int software_interuupt; +int Rmotor_speed=0; +int Lmotor_speed=0; int r_time () { int mseconds = (int)time(NULL)+(int)t.read_ms(); @@ -84,10 +86,17 @@ myled = 0; wait_ms(500); bt.baud(BaudRate_bt); - myled = 1; accelgyro.initialize(); t.start(); - SRX = 0; + SRX = 1; + wait_us(30); + SRX=0; + wait_ms(300); + SRX = 1; + wait_us(30); + SRX=0; + wait(1); + myled = 1; } //*********************************MOTORS*********************************// @@ -245,6 +254,12 @@ dx=delta_x+dx; dy=delta_y+dy; dtheta=delta_thetha*180/M_PI; + //bt.lock(); + //bt.printf(">>D;%0.2lf;%0.2lf;%0.2lf;%0.2lf;%d;%d;%d;\r\n", + // left_current_reading,right_current_reading,left_change ,right_change,\ + // dx,dy,\ + // dtheta); + //bt.unlock(); stdio_mutex.unlock(); Thread:: wait(50); }
--- a/robot.h Sun Oct 12 13:33:06 2014 +0000 +++ b/robot.h Sun Oct 12 23:27:33 2014 +0000 @@ -114,6 +114,8 @@ extern AnalogIn uB; extern int dy; extern int dx; +extern int Rmotor_speed; +extern int Lmotor_speed; int r_time (); void motor_control(int Lspeed, int Rspeed); //Input speed for motors. Integer between 0 and 100 void stop(); //stop motors