a
Dependents: 3servotest 1stcomp 3rdcompfixstart 2ndcomp ... more
Fork of Servo by
Revision 7:919db47443f4, committed 2016-09-16
- Comitter:
- choutin
- Date:
- Fri Sep 16 08:50:07 2016 +0000
- Parent:
- 6:b0d581acc298
- Child:
- 8:5a8a6a3b9f33
- Commit message:
- a
Changed in this revision
servo.cpp | Show annotated file Show diff for this revision Revisions of this file |
servo.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/servo.cpp Sun Sep 11 11:39:48 2016 +0000 +++ b/servo.cpp Fri Sep 16 08:50:07 2016 +0000 @@ -5,6 +5,8 @@ PwmOut pwmbelt(PC_9); float PERIOD=20000; +const float btime=1.8; + void armdegree(int degree) { int i; @@ -82,7 +84,7 @@ pwmhand.period_ms(20); //20ms - degree=90; + degree=83; i=500+degree*1900/180; pwmhand.write(i/PERIOD); @@ -97,10 +99,18 @@ pwmarm.period_ms(20); //20ms - degree=50; + degree=30; i=500+degree*1900/180; pwmarm.write(i/PERIOD); } + +void lift(){ + +beltup(); +wait(btime); +beltstop(); + +} \ No newline at end of file
--- a/servo.h Sun Sep 11 11:39:48 2016 +0000 +++ b/servo.h Fri Sep 16 08:50:07 2016 +0000 @@ -16,4 +16,6 @@ void beltdown(void); -void beltstop(void); \ No newline at end of file +void beltstop(void); + +void lift(void); \ No newline at end of file