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.
RightServoMotor.h@1:4ec28912c9e7, 2015-03-26 (annotated)
- Committer:
- avinashr
- Date:
- Thu Mar 26 02:25:46 2015 +0000
- Revision:
- 1:4ec28912c9e7
- Child:
- 2:2cc70773996b
Motors and Keypad working
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
avinashr | 1:4ec28912c9e7 | 1 | #include "mbed.h" |
avinashr | 1:4ec28912c9e7 | 2 | |
avinashr | 1:4ec28912c9e7 | 3 | /*Right Door Actuator*/ |
avinashr | 1:4ec28912c9e7 | 4 | |
avinashr | 1:4ec28912c9e7 | 5 | class RightServoMotor { |
avinashr | 1:4ec28912c9e7 | 6 | private: |
avinashr | 1:4ec28912c9e7 | 7 | PwmOut outputPin; |
avinashr | 1:4ec28912c9e7 | 8 | public: |
avinashr | 1:4ec28912c9e7 | 9 | RightServoMotor (PinName outputPin_): outputPin(outputPin_) {outputPin.period(0.020);} |
avinashr | 1:4ec28912c9e7 | 10 | void open(); |
avinashr | 1:4ec28912c9e7 | 11 | void close(); |
avinashr | 1:4ec28912c9e7 | 12 | }; |
avinashr | 1:4ec28912c9e7 | 13 | |
avinashr | 1:4ec28912c9e7 | 14 | void RightServoMotor::open(){ |
avinashr | 1:4ec28912c9e7 | 15 | outputPin = 0.125f; |
avinashr | 1:4ec28912c9e7 | 16 | } |
avinashr | 1:4ec28912c9e7 | 17 | |
avinashr | 1:4ec28912c9e7 | 18 | void RightServoMotor::close(){ |
avinashr | 1:4ec28912c9e7 | 19 | outputPin = 0.075f; |
avinashr | 1:4ec28912c9e7 | 20 | } |