123123123123123123123123123

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers buzzer.h Source File

buzzer.h

00001 /******************************************************
00002 
00003 ****┏┓          ┏┓
00004 **┏┛┻━━━━━━┛┻┓
00005 **┃                 ┃
00006 **┃      ━━━      ┃
00007 **┃  ┳┛       ┗┳ ┃
00008 **┃                 ┃
00009 **┃ '''    ┻   ''' ┃
00010 **┃                 ┃
00011 **┗━━┓       ┏━━┛
00012 *******┃       ┃
00013 *******┃       ┃
00014 *******┃       ┃
00015 *******┃       ┗━━━━━━━━┓
00016 *******┃                      ┃━┓
00017 *******┃      NO BUG          ┏━┛
00018 *******┃                      ┃
00019 *******┗━┓  ┓  ┏━┏━┓  ━┛
00020 ***********┃  ┛  ┛    ┃  ┛  ┛
00021 ***********┃  ┃  ┃    ┃  ┃  ┃
00022 ***********┗━┛━┛     ┗━┛━┛
00023 
00024 This part is added by project ESDC2014 of CUHK team.
00025 All the code with this header are under GPL open source license.
00026 This program is running on Mbed Platform 'mbed LPC1768' avaliable in 'http://mbed.org'.
00027 **********************************************************/
00028 
00029 #ifndef _BUZZER_H
00030 #define _BUZZER_H
00031 
00032 #include "define.h"
00033 #include "mbed.h"
00034 
00035 #define TIME_OUT 5 //8 seconds
00036 
00037 class Buzzer
00038 {
00039 public:
00040     Buzzer(MyDigitalOut* buzzer);
00041     ~Buzzer();
00042     void ON();
00043     void OFF();
00044     void setFlag();
00045     void cleanFlag();
00046     
00047     void check_time_out();
00048     void time_out_init();
00049     
00050 private:
00051     MyDigitalOut* _buzzer; 
00052     uint8_t flag;
00053     Timeout time_out;
00054 };
00055 
00056 #endif