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.
Servo.cpp
- Committer:
- leonNg
- Date:
- 2020-06-23
- Revision:
- 0:e35f0aee6a1f
File content as of revision 0:e35f0aee6a1f:
#include "mbed.h"
#include "Servo.h"
Servo::Servo(PinName pin, double period, double pulseWidth)
{
servo = new PwmOut(pin);
this->period = period;
this->pulseWidth = pulseWidth;
init();
}
void Servo::servoMove(double width)
{
servo->pulsewidth(width);
}
void Servo::init()
{
servo->period(period);
}