BA
/
BaBoRo1
Erste version der Software für der Prototyp
main.cpp@0:380207fcb5c1, 2018-03-29 (annotated)
- Committer:
- borlanic
- Date:
- Thu Mar 29 07:02:09 2018 +0000
- Revision:
- 0:380207fcb5c1
- Child:
- 1:d5c5bb30ac90
Encoder, IMU --> OK; Controller --> in bearbeitung
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
borlanic | 0:380207fcb5c1 | 1 | #include "mbed.h" |
borlanic | 0:380207fcb5c1 | 2 | #include "EncoderCounter.h" |
borlanic | 0:380207fcb5c1 | 3 | #include "IMU.h" |
borlanic | 0:380207fcb5c1 | 4 | #include "Controller.h" |
borlanic | 0:380207fcb5c1 | 5 | |
borlanic | 0:380207fcb5c1 | 6 | // create miscellaneous periphery objects |
borlanic | 0:380207fcb5c1 | 7 | DigitalOut led1(LED1); |
borlanic | 0:380207fcb5c1 | 8 | |
borlanic | 0:380207fcb5c1 | 9 | // create motor control objects |
borlanic | 0:380207fcb5c1 | 10 | |
borlanic | 0:380207fcb5c1 | 11 | // create distance sensor objects |
borlanic | 0:380207fcb5c1 | 12 | |
borlanic | 0:380207fcb5c1 | 13 | // create robot controller objects |
borlanic | 0:380207fcb5c1 | 14 | |
borlanic | 0:380207fcb5c1 | 15 | // create serial comunication objects, bluetooth/wifi |
borlanic | 0:380207fcb5c1 | 16 | |
borlanic | 0:380207fcb5c1 | 17 | // enter main loop |
borlanic | 0:380207fcb5c1 | 18 | int main() |
borlanic | 0:380207fcb5c1 | 19 | { |
borlanic | 0:380207fcb5c1 | 20 | // instance objects |
borlanic | 0:380207fcb5c1 | 21 | |
borlanic | 0:380207fcb5c1 | 22 | //IMU |
borlanic | 0:380207fcb5c1 | 23 | //controller |
borlanic | 0:380207fcb5c1 | 24 | //stateMachine |
borlanic | 0:380207fcb5c1 | 25 | |
borlanic | 0:380207fcb5c1 | 26 | while (true) { |
borlanic | 0:380207fcb5c1 | 27 | |
borlanic | 0:380207fcb5c1 | 28 | //printf tests |
borlanic | 0:380207fcb5c1 | 29 | |
borlanic | 0:380207fcb5c1 | 30 | led1 = !led1; |
borlanic | 0:380207fcb5c1 | 31 | wait(0.5); |
borlanic | 0:380207fcb5c1 | 32 | } |
borlanic | 0:380207fcb5c1 | 33 | } |