The final project of Embedde class.

Dependencies:   C12832 LM75B ESP-call MMA7660

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers BELL.cpp Source File

BELL.cpp

00001 #include "BELL.h"
00002 
00003 Timer alarmDuration;
00004 
00005 void bellSingleAlert(int duration)
00006 {
00007     alarmDuration.reset();
00008     alarmDuration.start();
00009     while(alarmDuration.read_ms() <= duration) {
00010         buzzerRinging(4, 50, NOTE_C6);
00011         thread_sleep_for(1000);
00012     }
00013     alarmDuration.stop();
00014 }
00015 void bellSingleAlert2(int duration)
00016 {
00017     alarmDuration.reset();
00018     alarmDuration.start();
00019     while(alarmDuration.read() <= duration) {
00020         buzzerRinging(1, 500, NOTE_C6);
00021     }
00022     alarmDuration.stop();    
00023 }