EE149
/
FinalProject
Final Project files for mBed development.
main.c@7:6e5cc24e1ce7, 2014-11-13 (annotated)
- Committer:
- lsaristo
- Date:
- Thu Nov 13 05:02:37 2014 +0000
- Revision:
- 7:6e5cc24e1ce7
- Parent:
- 6:00b7198f0b51
- Child:
- 8:12d780f7443e
Fixed bugs from previous changes
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lsaristo | 1:7e0243c27ecb | 1 | /** |
lsaristo | 1:7e0243c27ecb | 2 | * @file driver.c |
lsaristo | 1:7e0243c27ecb | 3 | * @brief Basic driver program for our robot's controller logic. |
lsaristo | 1:7e0243c27ecb | 4 | * |
lsaristo | 1:7e0243c27ecb | 5 | * Maybe add lots of stuff here or maybe split it off into |
lsaristo | 1:7e0243c27ecb | 6 | * multiple subfiles? |
lsaristo | 1:7e0243c27ecb | 7 | * |
lsaristo | 1:7e0243c27ecb | 8 | * @author John Wilkey |
lsaristo | 1:7e0243c27ecb | 9 | */ |
John Wilkey |
5:01882c3de2dc | 10 | #include "project.h" |
John Wilkey |
5:01882c3de2dc | 11 | |
John Wilkey |
5:01882c3de2dc | 12 | /** |
John Wilkey |
5:01882c3de2dc | 13 | * These are global data Used externally in all other files |
John Wilkey |
5:01882c3de2dc | 14 | */ |
lsaristo | 7:6e5cc24e1ce7 | 15 | m3pi pi; |
lsaristo | 7:6e5cc24e1ce7 | 16 | DigitalOut pin15(p15); |
lsaristo | 7:6e5cc24e1ce7 | 17 | DigitalOut pin16(p16); |
lsaristo | 7:6e5cc24e1ce7 | 18 | DigitalOut pin17(p17); |
lsaristo | 7:6e5cc24e1ce7 | 19 | DigitalOut pin18(p18); |
lsaristo | 7:6e5cc24e1ce7 | 20 | DigitalOut pin19(p19); |
lsaristo | 7:6e5cc24e1ce7 | 21 | DigitalOut pin20(p20); |
lsaristo | 7:6e5cc24e1ce7 | 22 | |
John Wilkey |
5:01882c3de2dc | 23 | |
John Wilkey |
5:01882c3de2dc | 24 | /** |
John Wilkey |
5:01882c3de2dc | 25 | * @brief Entry point. Main loop. |
John Wilkey |
5:01882c3de2dc | 26 | */ |
John Wilkey |
5:01882c3de2dc | 27 | int main() |
John Wilkey |
5:01882c3de2dc | 28 | { |
John Wilkey |
5:01882c3de2dc | 29 | pretty_print("PiCO"); |
John Wilkey |
6:00b7198f0b51 | 30 | |
John Wilkey |
6:00b7198f0b51 | 31 | while(1) { |
John Wilkey |
6:00b7198f0b51 | 32 | wait(2); |
John Wilkey |
6:00b7198f0b51 | 33 | forward(10, DRIVE_SPEED); |
John Wilkey |
6:00b7198f0b51 | 34 | wait(2); |
John Wilkey |
6:00b7198f0b51 | 35 | backward(10, DRIVE_SPEED); |
John Wilkey |
6:00b7198f0b51 | 36 | } |
John Wilkey |
6:00b7198f0b51 | 37 | |
John Wilkey |
6:00b7198f0b51 | 38 | // |
John Wilkey |
6:00b7198f0b51 | 39 | // Our code should NEVER reach this point. |
John Wilkey |
6:00b7198f0b51 | 40 | return EXIT_FAILURE; |
John Wilkey |
5:01882c3de2dc | 41 | } |