![](/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-06
- Revision:
- 13:d49cb8b52a1e
- Parent:
- 8:4d7b2dbdb694
- Child:
- 14:82248fb06e53
File content as of revision 13:d49cb8b52a1e:
#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(1510); } void servo_slowright(){ pin25.pulsewidth_us(1550); pin26.pulsewidth_us(1550); } void servo_slowleft(){ pin25.pulsewidth_us(1450); pin26.pulsewidth_us(1450); }