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
- Committer:
- Sarahi
- Date:
- 2014-08-28
- Revision:
- 0:2f4a2a0fe4b1
File content as of revision 0:2f4a2a0fe4b1:
#include "mbed.h"
PwmOut PWM1(D5);
void mover_servo (int tem);
int main()
{
PWM1.period_ms(20); //Periodo de 10 ms
while (true){
int t = 10;
mover_servo(t);
}
}
void mover_servo(int tem){
int pulso = tem * 25 + 1000;
PWM1.pulsewidth_us(pulso);
}