Robot code for searching an object and charging at it.

Dependencies:   HCSR04 Motor mbed

Files at this revision

API Documentation at this revision

Comitter:
abdsha01
Date:
Sat May 23 15:08:23 2015 +0000
Parent:
4:0507835a3dce
Child:
6:af897173cb75
Commit message:
Added more comments

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Sat May 23 15:05:18 2015 +0000
+++ b/main.cpp	Sat May 23 15:08:23 2015 +0000
@@ -11,22 +11,33 @@
 // The following code will control a robotic car
 // by detetecting an object and charging towards it
 // it uses basic functions as:
-// charge()        - used to charge on an object detected 
-//                   the robot will move in a straight line
-//                   until it detects the arena line where
-//                   it will use reverse() to move back
-// detect_object() - used to detect an object, the robot will
-//                   move in a circle to find an object and 
-//                   return 1 if it finds something and return
-//                   0 if it does not find anything - the search
-//                   will be carried out for 10 seconds.
-// detect_line ()  - used to detect a line, it returns the following
-//                   an int value as follows:
-//                   0  - if no line is detected
-//                   1  - if line detected from the front
-//                   -1 - if line detected from the back
-// reverse()       - reverses the robot with chargespeed in same position
-// reverseandturn()- reverses whie moving in a circular direction
+//
+// charge(speed)        
+//                      -   used to charge on an object detected 
+//                          the robot will move in a straight line
+//                          until it detects the arena line where
+//                          it will use reverse() to move back
+//
+// detect_object(range, speed)
+//                      -   used to detect an object, the robot will
+//                          move in a circle to find an object and 
+//                          return 1 if it finds something and return
+//                          0 if it does not find anything - the search
+//                          will be carried out for 10 seconds.
+//
+// detect_line ()       
+//                      -   used to detect a line, it returns the following
+//                          an int value as follows:
+//                          0  - if no line is detected
+//                          1  - if line detected from the front
+//                          -1 - if line detected from the back
+//
+// reverse(speed)       
+//                      -   reverses the robot with chargespeed in same position
+
+// reverseandturn(speed)     
+//                      -   reverses whie moving in a circular direction
+//
 
 // Libraries for using the above functions and more ...
 #include "mbed.h"