RenBuggyTimed with edited function and access to seven segment display
Dependencies: SevenSegmentDisplay mbed
Fork of 1-RenBuggyTimed by
TimedMovement.h@1:91ca3ea0f578, 2016-04-13 (annotated)
- Committer:
- DanArgust
- Date:
- Wed Apr 13 07:04:28 2016 +0000
- Revision:
- 1:91ca3ea0f578
- Parent:
- 0:9870f526ddd1
Release 0.0.1 1-RenBuggyTimed with changes all functions and including access to Seven Segment Display
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
RenBuggy | 0:9870f526ddd1 | 1 | /********************************************************* |
RenBuggy | 0:9870f526ddd1 | 2 | *TimedMovement.h * |
RenBuggy | 0:9870f526ddd1 | 3 | *Author: Elijah Orr * |
RenBuggy | 0:9870f526ddd1 | 4 | * * |
RenBuggy | 0:9870f526ddd1 | 5 | *A library of functions that can be used to control the * |
RenBuggy | 0:9870f526ddd1 | 6 | *RenBuggy. * |
RenBuggy | 0:9870f526ddd1 | 7 | *********************************************************/ |
RenBuggy | 0:9870f526ddd1 | 8 | |
RenBuggy | 0:9870f526ddd1 | 9 | /* include guards are used to prevent problems caused by |
RenBuggy | 0:9870f526ddd1 | 10 | multiple definitions */ |
RenBuggy | 0:9870f526ddd1 | 11 | #ifndef TIMEDMOVEMENT_H |
RenBuggy | 0:9870f526ddd1 | 12 | #define TIMEDMOVEMENT_H |
RenBuggy | 0:9870f526ddd1 | 13 | |
RenBuggy | 0:9870f526ddd1 | 14 | /* mbed.h must be included in this file also */ |
RenBuggy | 0:9870f526ddd1 | 15 | #include "mbed.h" |
RenBuggy | 0:9870f526ddd1 | 16 | |
RenBuggy | 0:9870f526ddd1 | 17 | /* #define LeftMotorPin p5 tells the preprocessor to replace |
RenBuggy | 0:9870f526ddd1 | 18 | any mention of LeftMotorPin with p5. This is used to select |
RenBuggy | 0:9870f526ddd1 | 19 | which pins to use to control the motors. Here pins 5 and 6 |
RenBuggy | 0:9870f526ddd1 | 20 | are used. */ |
RenBuggy | 0:9870f526ddd1 | 21 | #define LeftMotorPin p5 |
RenBuggy | 0:9870f526ddd1 | 22 | #define RightMotorPin p6 |
RenBuggy | 0:9870f526ddd1 | 23 | |
RenBuggy | 0:9870f526ddd1 | 24 | /* these are function prototypes that declare all the functions |
RenBuggy | 0:9870f526ddd1 | 25 | in the library. extern tells the compiler that the functions |
RenBuggy | 0:9870f526ddd1 | 26 | may be called in other files, such as main.cpp. void specifies |
RenBuggy | 0:9870f526ddd1 | 27 | that the function will not return a value, i.e. the program will |
RenBuggy | 0:9870f526ddd1 | 28 | execute the function and then move on the the next line of code. |
RenBuggy | 0:9870f526ddd1 | 29 | forward is the name of the function and float specifies that |
RenBuggy | 0:9870f526ddd1 | 30 | the function expects to be passed a variable of the format float. */ |
RenBuggy | 0:9870f526ddd1 | 31 | extern void forward(float); |
RenBuggy | 0:9870f526ddd1 | 32 | extern void left(float); |
RenBuggy | 0:9870f526ddd1 | 33 | extern void right(float); |
DanArgust | 1:91ca3ea0f578 | 34 | extern void hold(float); |
DanArgust | 1:91ca3ea0f578 | 35 | extern void stop(); |
DanArgust | 1:91ca3ea0f578 | 36 | |
DanArgust | 1:91ca3ea0f578 | 37 | extern void readButton(float); |
DanArgust | 1:91ca3ea0f578 | 38 | extern int rollDice(); |
RenBuggy | 0:9870f526ddd1 | 39 | /* stop() is slightly different in that it doesn't expect to be passed |
RenBuggy | 0:9870f526ddd1 | 40 | any variables, so the parentheses can be left empty. Passing a variable |
RenBuggy | 0:9870f526ddd1 | 41 | to this function would cause an error */ |
RenBuggy | 0:9870f526ddd1 | 42 | |
RenBuggy | 0:9870f526ddd1 | 43 | #endif // TIMEDMOVEMENT_H |