Ren Buggy / 1-RenBuggyTimed

Dependencies:   mbed-renbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers TimedMovement.h Source File

TimedMovement.h

00001 /*********************************************************
00002 *TimedMovement.h                                         *
00003 *Author: Elijah Orr                                      *
00004 *                                                        *  
00005 *A library of functions that can be used to control the  * 
00006 *RenBuggy.                                               *
00007 *********************************************************/
00008 
00009 /* include guards are used to prevent problems caused by 
00010 multiple definitions */
00011 #ifndef TIMEDMOVEMENT_H
00012 #define TIMEDMOVEMENT_H
00013 
00014 /* mbed.h must be included in this file also */
00015 #include "mbed.h"
00016 
00017 /* #define LeftMotorPin PWM2 tells the preprocessor to replace
00018 any mention of LeftMotorPin with PWM2. This is used to select 
00019 which pins to use to control the motors. Here pins DIP10 and DIP25 
00020 are used, which correspond to PWM2 (P1_26) and PWM8 (P1_24). */
00021 #define LeftMotorPin PWM2
00022 #define RightMotorPin PWM8
00023 
00024 /* these are function prototypes that declare all the functions
00025 in the library. extern tells the compiler that the functions
00026 may be called in other files, such as main.cpp. void specifies 
00027 that the function will not return a value, i.e. the program will 
00028 execute the function and then move on the the next line of code. 
00029 forward is the name of the function and float specifies that 
00030 the function expects to be passed a variable of the format float. */
00031 extern void forward(float);
00032 extern void left(float);
00033 extern void right(float);
00034 /* stop() is slightly different in that it doesn't expect to be passed
00035 any variables, so the parentheses can be left empty. Passing a variable
00036 to this function would cause an error */
00037 void stop();
00038 
00039 #endif // TIMEDMOVEMENT_H