Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp@1:4ec28912c9e7, 2015-03-26 (annotated)
- Committer:
- avinashr
- Date:
- Thu Mar 26 02:25:46 2015 +0000
- Revision:
- 1:4ec28912c9e7
- Parent:
- 0:27111a353928
- Child:
- 2:2cc70773996b
Motors and Keypad working
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| avinashr | 0:27111a353928 | 1 | #include "mbed.h" |
| avinashr | 0:27111a353928 | 2 | #include "DCMotor.h" |
| avinashr | 1:4ec28912c9e7 | 3 | #include "LeftServoMotor.h" |
| avinashr | 1:4ec28912c9e7 | 4 | #include "RightServoMotor.h" |
| avinashr | 1:4ec28912c9e7 | 5 | #include "Keypad.h" |
| avinashr | 1:4ec28912c9e7 | 6 | //#include "RequestQueue.h" |
| avinashr | 1:4ec28912c9e7 | 7 | |
| avinashr | 0:27111a353928 | 8 | DigitalOut myled(LED1); |
| avinashr | 1:4ec28912c9e7 | 9 | |
| avinashr | 0:27111a353928 | 10 | int main() { |
| avinashr | 1:4ec28912c9e7 | 11 | initializeKeypad(); |
| avinashr | 0:27111a353928 | 12 | DCMotor dcMotor(p21,p17,p18); |
| avinashr | 1:4ec28912c9e7 | 13 | LeftServoMotor leftDoor(p22); |
| avinashr | 1:4ec28912c9e7 | 14 | RightServoMotor rightDoor(p23); |
| avinashr | 0:27111a353928 | 15 | while(1) { |
| avinashr | 1:4ec28912c9e7 | 16 | //dcMotor.forward(); |
| avinashr | 1:4ec28912c9e7 | 17 | leftDoor.open(); |
| avinashr | 1:4ec28912c9e7 | 18 | rightDoor.open(); |
| avinashr | 0:27111a353928 | 19 | myled = 1; |
| avinashr | 1:4ec28912c9e7 | 20 | //pc.printf("dada"); |
| avinashr | 1:4ec28912c9e7 | 21 | wait(3); |
| avinashr | 1:4ec28912c9e7 | 22 | //dcMotor.stop(); |
| avinashr | 1:4ec28912c9e7 | 23 | leftDoor.close(); |
| avinashr | 1:4ec28912c9e7 | 24 | rightDoor.close(); |
| avinashr | 0:27111a353928 | 25 | myled = 0; |
| avinashr | 1:4ec28912c9e7 | 26 | wait(3); |
| avinashr | 0:27111a353928 | 27 | } |
| avinashr | 1:4ec28912c9e7 | 28 | } |