Preston Stephens
/
MiniProject5_LightTracker
Final
Fork of MiniProject5_LightTracker by
Diff: ServoControl.cpp
- Revision:
- 6:992875df04f7
- Child:
- 7:30afa5506e74
diff -r d50d55831d50 -r 992875df04f7 ServoControl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ServoControl.cpp Mon Jan 11 21:57:16 2016 +0000 @@ -0,0 +1,15 @@ +//Control Function for servo + +#include ServoControl.h + +PwnOut ServoSignal(p21); //P21 is PWM signal out to servo + +void ServoInit(void){ + ServoSignal.period(0.020); +} + +float ServoSignal(float angle){ + ServoSignal.pulsewidth_us(1500+10*angle); + +} +