![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Temp and Pressure get on BMP180
Dependencies: BLE_API BMP180 mbed nRF51822
Fork of nRF51822_SimpleControls by
Servo.cpp
- Committer:
- RedBearLab
- Date:
- 2014-10-31
- Revision:
- 0:dfcebc1e442a
- Child:
- 1:f03072e32ed3
File content as of revision 0:dfcebc1e442a:
#include "Servo.h" Servo::Servo(PinName pin) : _servo(pin) { _servo.period_ms(20); } Servo::~Servo(void) { } void Servo::write(unsigned char degree) { convert(degree); _servo.pulsewidth_us(pulse); } void Servo::convert(unsigned char degree) { // 0~180 degree correspond to 500~2500 pulse = degree * 11 + 500; }