![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
vf
Dependencies: Servo ServoArm mbed
Fork of PES_Official by
Diff: Sources/main.cpp
- Revision:
- 2:01e9de508316
- Parent:
- 1:388c915756f5
- Child:
- 4:67d7177c213f
diff -r 388c915756f5 -r 01e9de508316 Sources/main.cpp --- a/Sources/main.cpp Sun Mar 19 12:20:26 2017 +0000 +++ b/Sources/main.cpp Tue Mar 21 13:12:54 2017 +0000 @@ -38,12 +38,18 @@ /* */ int main(){ + Timer t; + t.start(); initializeDistanceSensors(); - int counter = 0; //counts how many times the robot has turned, before driving + int counter = 0; //counts how many times the robot has turned, before driving while( 1 ){ - sam.search(&counter); + if ( t.read() > TIMEOUT ){ + NVIC_SystemReset(); //Resets Sam. + } + + sam.search(&counter, &t); wait( 0.1f ); } return 0;