Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
ServoDrive.h
00001 /********************************************************* 00002 *ServoDrive.h * 00003 *Author: Elijah Orr * 00004 * * 00005 *A library of functions that can be used to control the * 00006 *RenBuggy via a servo motor. * 00007 *********************************************************/ 00008 00009 /* include guards are used to prevent problems caused by 00010 multiple definitions */ 00011 #ifndef SERVODRIVE_H 00012 #define SERVODRIVE_H 00013 00014 /* mbed.h must be included in this file also */ 00015 #include "mbed.h" 00016 00017 /* #define is used to set the pins that will be used to control the motors. 00018 Using this method means that selecting which pins are used requires only 00019 changing values here, rather than in every function that contains them. */ 00020 #define servoPin p10 00021 #define LeftMotorPin p5 00022 #define RightMotorPin p6 00023 00024 /* function declarations go here */ 00025 extern void go(); 00026 extern void stop(); 00027 /* setDirection takes a variable of type float (non integer) that will represent an angle in 00028 degrees. */ 00029 extern int setDirection(float); 00030 /* configurePWM expects two variables of type int */ 00031 extern void configurePWM(int, int); 00032 00033 #endif //SERVODRIVE_H
Generated on Fri Jul 15 2022 13:07:46 by
1.7.2