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@0:27111a353928, 2015-03-24 (annotated)
- Committer:
- avinashr
- Date:
- Tue Mar 24 00:09:00 2015 +0000
- Revision:
- 0:27111a353928
- Child:
- 1:4ec28912c9e7
Basic class structure;
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 | 0:27111a353928 | 3 | #include "ServoMotor.h" |
| avinashr | 0:27111a353928 | 4 | |
| avinashr | 0:27111a353928 | 5 | DigitalOut myled(LED1); |
| avinashr | 0:27111a353928 | 6 | |
| avinashr | 0:27111a353928 | 7 | int main() { |
| avinashr | 0:27111a353928 | 8 | DCMotor dcMotor(p21,p17,p18); |
| avinashr | 0:27111a353928 | 9 | //ServoMotor leftDoor(p11); |
| avinashr | 0:27111a353928 | 10 | while(1) { |
| avinashr | 0:27111a353928 | 11 | dcMotor.forward(); |
| avinashr | 0:27111a353928 | 12 | myled = 1; |
| avinashr | 0:27111a353928 | 13 | wait(1); |
| avinashr | 0:27111a353928 | 14 | dcMotor.reverse(); |
| avinashr | 0:27111a353928 | 15 | myled = 0; |
| avinashr | 0:27111a353928 | 16 | wait(1); |
| avinashr | 0:27111a353928 | 17 | } |
| avinashr | 0:27111a353928 | 18 | } |