Avinash Repaka / Mbed 2 deprecated Lab4_519

Dependencies:   mbed

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?

UserRevisionLine numberNew 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