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 Boboobooov4 by
servo_api.cpp
- Committer:
- backman
- Date:
- 2014-06-29
- Revision:
- 15:585df3979be8
- Parent:
- 10:03d5aa2511c4
- Child:
- 22:34a0c436ac45
File content as of revision 15:585df3979be8:
// 0~180 angle 1~2ms #include "mbed.h" #include "servo_api.h" #define right_end 0.037 //90 0.037 #define left_end 0.073 //-90 0.073 //memory opt // 5 degree seperate BX_servo::BX_servo(void){ angle = 0; servo_in= new PwmOut(PTB0); servo_in->period_ms(20); } float BX_servo::set_angle(float a){ /* if( a>left_end ) a=left_end; else if(a< right_end) a=right_end; */ angle=a; *servo_in=angle; return angle; }