For educational purposes
Dependencies: mbed
main.cpp@0:7116cced0ada, 2014-03-26 (annotated)
- Committer:
- chrisell512
- Date:
- Wed Mar 26 01:16:35 2014 +0000
- Revision:
- 0:7116cced0ada
- Child:
- 1:414699543271
COSC 2425 Group Project
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
chrisell512 | 0:7116cced0ada | 1 | #include "mbed.h" |
chrisell512 | 0:7116cced0ada | 2 | #include "m3pi.h" |
chrisell512 | 0:7116cced0ada | 3 | |
chrisell512 | 0:7116cced0ada | 4 | m3pi m3pi; |
chrisell512 | 0:7116cced0ada | 5 | |
chrisell512 | 0:7116cced0ada | 6 | int main() { |
chrisell512 | 0:7116cced0ada | 7 | |
chrisell512 | 0:7116cced0ada | 8 | m3pi.locate(0,1); |
chrisell512 | 0:7116cced0ada | 9 | m3pi.printf("Whatever"); |
chrisell512 | 0:7116cced0ada | 10 | |
chrisell512 | 0:7116cced0ada | 11 | wait(1.0); //wait 2 seconds |
chrisell512 | 0:7116cced0ada | 12 | |
chrisell512 | 0:7116cced0ada | 13 | m3pi.left_motor(-0.51); //foward at full speed |
chrisell512 | 0:7116cced0ada | 14 | m3pi.right_motor(-0.35); |
chrisell512 | 0:7116cced0ada | 15 | wait(5.0); |
chrisell512 | 0:7116cced0ada | 16 | m3pi.stop(); |
chrisell512 | 0:7116cced0ada | 17 | wait(0.5); |
chrisell512 | 0:7116cced0ada | 18 | m3pi.left_motor(0.65); //foward at full speed |
chrisell512 | 0:7116cced0ada | 19 | m3pi.right_motor(0.28); |
chrisell512 | 0:7116cced0ada | 20 | wait(5.0); //wait one second |
chrisell512 | 0:7116cced0ada | 21 | |
chrisell512 | 0:7116cced0ada | 22 | |
chrisell512 | 0:7116cced0ada | 23 | m3pi.stop(); |
chrisell512 | 0:7116cced0ada | 24 | |
chrisell512 | 0:7116cced0ada | 25 | } |