PlayBack
Dependencies: TPixy-Interface
Fork of ObjectFollower by
main.cpp@4:417e475239c7, 2018-02-09 (annotated)
- Committer:
- asobhy
- Date:
- Fri Feb 09 18:37:11 2018 +0000
- Revision:
- 4:417e475239c7
- Parent:
- 1:3e9684e81312
- Child:
- 8:a0890fa79084
beginning of lab 02/09/2018
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
asobhy | 0:a355e511bc5d | 1 | // ECE4333 |
asobhy | 0:a355e511bc5d | 2 | // Authors: Ahmed Sobhy & Brandon Kingman |
asobhy | 0:a355e511bc5d | 3 | // Project: Robot |
asobhy | 0:a355e511bc5d | 4 | |
asobhy | 0:a355e511bc5d | 5 | #include "mbed.h" |
asobhy | 0:a355e511bc5d | 6 | #include "WatchdogThread.h" |
asobhy | 0:a355e511bc5d | 7 | #include "PiControlThread.h" |
asobhy | 0:a355e511bc5d | 8 | #include "ExternalInterruptThread.h" |
asobhy | 0:a355e511bc5d | 9 | #include "ui.h" |
asobhy | 0:a355e511bc5d | 10 | |
asobhy | 0:a355e511bc5d | 11 | /******************************************************************************/ |
asobhy | 0:a355e511bc5d | 12 | |
asobhy | 0:a355e511bc5d | 13 | |
asobhy | 0:a355e511bc5d | 14 | |
asobhy | 0:a355e511bc5d | 15 | /******************************************************************************* |
asobhy | 0:a355e511bc5d | 16 | * ******** Main Thread ******** |
asobhy | 0:a355e511bc5d | 17 | *******************************************************************************/ |
asobhy | 0:a355e511bc5d | 18 | int main() // This thread executes first upon reset or power-on. |
asobhy | 0:a355e511bc5d | 19 | { |
asobhy | 0:a355e511bc5d | 20 | |
asobhy | 0:a355e511bc5d | 21 | // displays msg on terminal |
asobhy | 0:a355e511bc5d | 22 | displayStartupMsg(); |
asobhy | 0:a355e511bc5d | 23 | |
asobhy | 0:a355e511bc5d | 24 | // Initialize and run the threads below: |
asobhy | 0:a355e511bc5d | 25 | WatchdogThreadInit(); |
asobhy | 0:a355e511bc5d | 26 | PiControlThreadInit(); |
asobhy | 0:a355e511bc5d | 27 | ExternalInterruptThreadInit(); |
asobhy | 0:a355e511bc5d | 28 | |
asobhy | 0:a355e511bc5d | 29 | while(1) |
asobhy | 0:a355e511bc5d | 30 | { |
asobhy | 4:417e475239c7 | 31 | consoleUI(); |
asobhy | 0:a355e511bc5d | 32 | Thread::wait(500); // Go to sleep for 500 ms |
asobhy | 0:a355e511bc5d | 33 | } |
asobhy | 0:a355e511bc5d | 34 | } |