SimpleControls works with the BLEController iOS/Android App. The mbed's pin can acts as DIGITAL_IN, DIGITAL_OUT, PWM, SERVO, ANALOG_IN. The sketch is to show you how to control the pin as one of the abilities.

Dependencies:   BLE_API mbed nRF51822

Fork of BLENano_SimpleControls by RedBearLab

Servo.h

Committer:
RedBearLab
Date:
2014-10-31
Revision:
0:be2e4095513a
Child:
1:81a97eb70d3d

File content as of revision 0:be2e4095513a:

#ifndef _SERVO_H
#define _SERVO_H

#include "mbed.h"

class Servo
{
public:
    Servo(PinName pin);
    ~Servo(void);
    
    void write(unsigned char degree);

private:
    void convert(unsigned char degree);
    
    PwmOut _servo;
    unsigned int pulse;
};

#endif