![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Final
Fork of MiniProject5_LightTracker by
ServoControl.cpp@11:7b3d64a66efd, 2016-01-11 (annotated)
- Committer:
- pstephens18
- Date:
- Mon Jan 11 23:27:38 2016 +0000
- Revision:
- 11:7b3d64a66efd
- Parent:
- 8:96b30706335b
- Child:
- 13:871d01d0d250
Display Working
;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
asloop18 | 6:992875df04f7 | 1 | //Control Function for servo |
asloop18 | 6:992875df04f7 | 2 | |
asloop18 | 7:30afa5506e74 | 3 | #include "ServoControl.h" |
asloop18 | 6:992875df04f7 | 4 | |
asloop18 | 8:96b30706335b | 5 | PwmOut ServoSignal(p21); //P21 is PWM signal out to servo |
asloop18 | 6:992875df04f7 | 6 | |
asloop18 | 6:992875df04f7 | 7 | void ServoInit(void){ |
asloop18 | 6:992875df04f7 | 8 | ServoSignal.period(0.020); |
asloop18 | 6:992875df04f7 | 9 | } |
asloop18 | 6:992875df04f7 | 10 | |
asloop18 | 8:96b30706335b | 11 | float ServoControl(float angle){ |
pstephens18 | 11:7b3d64a66efd | 12 | ServoSignal.pulsewidth_us(1500+10*angle); |
pstephens18 | 11:7b3d64a66efd | 13 | return 0; |
asloop18 | 6:992875df04f7 | 14 | } |
asloop18 | 6:992875df04f7 | 15 |