![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
The servo version of SCRIBE
Dependencies: BLE_nRF8001 BNO055 HC_SR04_Ultrasonic_Library mbed-rtos mbed
Fork of SCRIBE_stepper by
servo.cpp
- Committer:
- nibab
- Date:
- 2016-05-04
- Revision:
- 6:91ff95c9a44e
- Child:
- 8:4d7b2dbdb694
File content as of revision 6:91ff95c9a44e:
#include "mbed.h" PwmOut pin25(p25); PwmOut pin26(p26); void servo_reset(){ pin25.period_ms(20); //Set the period: 20ms pin26.period_ms(20); //Set the period: 20ms } void servo_f(){ pin25.pulsewidth_us(1300); pin26.pulsewidth_us(1700); } void servo_b(){ pin25.pulsewidth_us(1700); pin26.pulsewidth_us(1300); } void servo_right(){ pin25.pulsewidth_us(1700); pin26.pulsewidth_us(1700); } void servo_left(){ pin25.pulsewidth_us(1300); pin26.pulsewidth_us(1300); } void servo_stop(){ pin25.pulsewidth_us(1500); pin26.pulsewidth_us(1515); }