Elecia White / Mbed 2 deprecated FistfulOfWires

Dependencies:   PixelArray mbed

BuzzMotor.h

Committer:
Elecia
Date:
2016-05-25
Revision:
1:0a051df78be2

File content as of revision 1:0a051df78be2:

#include "mbed.h"

// new class to play a pattern based on PwmOut class, based on SongPlayer: SongPlayer
// https://developer.mbed.org/users/4180_1/notebook/using-a-speaker-for-audio-output/
class BuzzMotor
{
public:
    BuzzMotor(PinName pin) : mPin(pin) {    
        // mPin(pin) means pass pin to the constructor
        mPin = 0.0;
    }
    void On() 
    {
        mPin = 1;
    }
    void Off() 
    {
        mPin = 0;
    }

private:
    Timeout duration;
    DigitalOut  mPin;
    typedef enum {RUMBLE=0, ONE_SEC_HIGH_TICK=1, ONE_SEC_LOW_TICK=2, QUIET=3 } eBuzzType;

};