123123123123123123123123123

Dependencies:   mbed

buzzer.h

Committer:
terryLAI
Date:
2014-07-03
Revision:
1:cbec1283a16a
Parent:
0:3417ca0a36c0
Child:
2:442902ec3aa1

File content as of revision 1:cbec1283a16a:

/******************************************************

****┏┓          ┏┓
**┏┛┻━━━━━━┛┻┓
**┃                 ┃
**┃      ━━━      ┃
**┃  ┳┛       ┗┳ ┃
**┃                 ┃
**┃ '''    ┻   ''' ┃
**┃                 ┃
**┗━━┓       ┏━━┛
*******┃       ┃
*******┃       ┃
*******┃       ┃
*******┃       ┗━━━━━━━━┓
*******┃                      ┃━┓
*******┃      NO BUG          ┏━┛
*******┃                      ┃
*******┗━┓  ┓  ┏━┏━┓  ━┛
***********┃  ┛  ┛    ┃  ┛  ┛
***********┃  ┃  ┃    ┃  ┃  ┃
***********┗━┛━┛     ┗━┛━┛

This part is added by project ESDC2014 of CUHK team.
All the code with this header are under GPL open source license.
This program is running on Mbed Platform 'mbed LPC1768' avaliable in 'http://mbed.org'.
**********************************************************/

#ifndef _BUZZER_H
#define _BUZZER_H

#include "define.h"
#include "mbed.h"

#define TIME_OUT 8 //8 seconds

class Buzzer
{
public:
    Buzzer(MyDigitalOut* buzzer);
    ~Buzzer();
    void ON();
    void OFF();
    void setFlag();
    void cleanFlag();
    
    void check_time_out();
    void time_out_init();
    
private:
    MyDigitalOut* _buzzer; 
    uint8_t flag;
    Timeout time_out;
};

#endif