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.
Fork of MiniProject5_LightTracker by
ServoControl.cpp
00001 //Control Function for servo 00002 00003 #include "ServoControl.h" 00004 00005 PwmOut ServoSignal(p21); //P21 is PWM signal out to servo 00006 00007 void ServoInit(void){ 00008 ServoSignal.period(0.020); 00009 } 00010 00011 int ServoControl(signed int angle){ 00012 if(angle<-90){angle=-89;} 00013 if(angle>90){angle=89;} 00014 ServoSignal.pulsewidth_us(1500+10*angle); 00015 return angle; 00016 } 00017 00018 00019
Generated on Tue Jul 12 2022 18:05:50 by
1.7.2
