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
00001 // Keep sweeping servo from left to right 00002 #include "mbed.h" 00003 #include "Servo.h" 00004 00005 Servo Servo1(p20); 00006 00007 int main() { 00008 Servo1.Enable(1000,20000); 00009 while(1) { 00010 for (int pos = 1000; pos < 2000; pos += 25) { 00011 Servo1.SetPosition(pos); 00012 wait_ms(20); 00013 } 00014 for (int pos = 2000; pos > 1000; pos -= 25) { 00015 Servo1.SetPosition(pos); 00016 wait_ms(20); 00017 } 00018 } 00019 }
Generated on Tue Jul 12 2022 12:33:03 by
