Robot code for searching an object and charging at it.

Dependencies:   HCSR04 Motor mbed

Committer:
lhartfield
Date:
Sun Jun 07 15:03:54 2015 +0000
Revision:
22:e808fb71847d
Parent:
20:37a89edd1cde
Child:
24:513c88816ed8
Changed function name from moverandom to move_random for consistency. Parameterized move_random().

Who changed what in which revision?

UserRevisionLine numberNew contents of line
abdsha01 4:0507835a3dce 1 // Header file for functions.cpp
abdsha01 4:0507835a3dce 2
abdsha01 20:37a89edd1cde 3 // Global parameters
abdsha01 20:37a89edd1cde 4 // Speed at which it move_forwards an object
abdsha01 20:37a89edd1cde 5 // optimum value: 0.4 to 0.8
abdsha01 20:37a89edd1cde 6 extern float move_forwardspeed;
abdsha01 20:37a89edd1cde 7 // Speed at which it rotates to find an object
abdsha01 20:37a89edd1cde 8 // optimum value: 0.3 to 0.5
abdsha01 20:37a89edd1cde 9 extern float searchspeed;
abdsha01 20:37a89edd1cde 10 // Range of detection
abdsha01 20:37a89edd1cde 11 // optimum value: 30 to 50
abdsha01 20:37a89edd1cde 12 extern unsigned int range;
abdsha01 20:37a89edd1cde 13
alex0612 19:67ea4e8be9e1 14 void flash_leds();
alex0612 19:67ea4e8be9e1 15 void turn_leds_on();
abdsha01 4:0507835a3dce 16 int read_line1();
abdsha01 4:0507835a3dce 17 int read_line2();
abdsha01 4:0507835a3dce 18 int detect_line();
lhartfield 22:e808fb71847d 19 void move_random(float speed=move_forwardspeed);
abdsha01 4:0507835a3dce 20 void reverse(float speed);
abdsha01 9:7770a84228c0 21 void turn(float speed);
abdsha01 4:0507835a3dce 22 void reverseandturn(float speed);
alex0612 19:67ea4e8be9e1 23 void move_forward(float speed);
abdsha01 4:0507835a3dce 24 void stop();
alex0612 11:b45798cc3c10 25 int detect_object(int range, float speed);
alex0612 11:b45798cc3c10 26 void move_detect(float speed, int fwd_bck, int time);