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:
- jdenkers
- Date:
- 2010-10-17
- Revision:
- 0:0d481c229e21
File content as of revision 0:0d481c229e21:
// Keep sweeping servo from left to right
#include "mbed.h"
#include "Servo.h"
Servo Servo1(p20);
int main() {
Servo1.Enable(1000,20000);
while(1) {
for (int pos = 1000; pos < 2000; pos += 25) {
Servo1.SetPosition(pos);
wait_ms(20);
}
for (int pos = 2000; pos > 1000; pos -= 25) {
Servo1.SetPosition(pos);
wait_ms(20);
}
}
}