Updated version of RenBuggy Servo that can accept instructions based on time or distance.

Dependencies:   PinDetect mbed

Fork of RenBuggyServo by Renishaw

Files at this revision

API Documentation at this revision

Comitter:
Markatron
Date:
Mon Mar 31 07:49:08 2014 +0000
Parent:
4:aac581bec332
Child:
6:5767cb4ed8de
Commit message:
Updated version number and example code

Changed in this revision

Car.cpp Show annotated file Show diff for this revision Revisions of this file
Car.h Show annotated file Show diff for this revision Revisions of this file
--- a/Car.cpp	Mon Mar 31 07:44:16 2014 +0000
+++ b/Car.cpp	Mon Mar 31 07:49:08 2014 +0000
@@ -22,7 +22,7 @@
 *                                                                              *
 * Car.cpp                                                                      *
 *                                                                              *
-* V1.0 05/03/2014                                          Mark Jones          *
+* V1.1 31/03/2014                                          Mark Jones          *
 *******************************************************************************/
 
 #ifndef CAR_C
--- a/Car.h	Mon Mar 31 07:44:16 2014 +0000
+++ b/Car.h	Mon Mar 31 07:49:08 2014 +0000
@@ -22,7 +22,7 @@
 *                                                                              *
 * Car.h                                                                        *
 *                                                                              *
-* V1. 05/03/2014                                           Mark Jones          *
+* V1.1 31/03/2014                                           Mark Jones         *
 *******************************************************************************/
 
 #ifndef CAR_H
@@ -44,19 +44,6 @@
 // Main entry point of application.
 int main() {
     
-    const int SERVO_PWM = 1500;             // 1500 = centre.
-    const int SERVO_PWM_PERIOD = 2000;  
-    const int SERVO_PWM_RANGE = 500;        // + or - 500 microseconds.
-    const float SERVO_DEGREES_RANGE = 45.0; // + or - from centre is full right/left.
-    
-    const int MOTOR_PWM = 20000;
-    const int MOTOR_PERIOD = 20000;
-    
-    // Configure the servo and motor before use.
-    myCar.configureServo_us(SERVO_PWM, SERVO_PWM_PERIOD, 
-    SERVO_PWM_RANGE, SERVO_DEGREES_RANGE);
-    myCar.configureMotor_us(MOTOR_PWM, MOTOR_PERIOD);
-    
     // Drive the RenBuggy!
     myCar.setSpeed(20000);
     myCar.setDirection(0);