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@2:2cc70773996b, 2015-03-26 (annotated)
- Committer:
- avinashr
- Date:
- Thu Mar 26 06:10:56 2015 +0000
- Revision:
- 2:2cc70773996b
- Parent:
- 1:4ec28912c9e7
Basic algorithm in place;
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 | 2:2cc70773996b | 3 | #ifndef RIGHTSERVOMOTOR_H |
avinashr | 2:2cc70773996b | 4 | #define RIGHTSERVOMOTOR_H |
avinashr | 1:4ec28912c9e7 | 5 | |
avinashr | 1:4ec28912c9e7 | 6 | class RightServoMotor { |
avinashr | 1:4ec28912c9e7 | 7 | private: |
avinashr | 1:4ec28912c9e7 | 8 | PwmOut outputPin; |
avinashr | 1:4ec28912c9e7 | 9 | public: |
avinashr | 1:4ec28912c9e7 | 10 | RightServoMotor (PinName outputPin_): outputPin(outputPin_) {outputPin.period(0.020);} |
avinashr | 1:4ec28912c9e7 | 11 | void open(); |
avinashr | 1:4ec28912c9e7 | 12 | void close(); |
avinashr | 1:4ec28912c9e7 | 13 | }; |
avinashr | 1:4ec28912c9e7 | 14 | |
avinashr | 1:4ec28912c9e7 | 15 | void RightServoMotor::open(){ |
avinashr | 1:4ec28912c9e7 | 16 | outputPin = 0.125f; |
avinashr | 1:4ec28912c9e7 | 17 | } |
avinashr | 1:4ec28912c9e7 | 18 | |
avinashr | 1:4ec28912c9e7 | 19 | void RightServoMotor::close(){ |
avinashr | 1:4ec28912c9e7 | 20 | outputPin = 0.075f; |
avinashr | 2:2cc70773996b | 21 | } |
avinashr | 2:2cc70773996b | 22 | |
avinashr | 2:2cc70773996b | 23 | #endif |