aboutsummaryrefslogtreecommitdiffstats
path: root/beep.c
diff options
context:
space:
mode:
Diffstat (limited to 'beep.c')
-rwxr-xr-xbeep.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/beep.c b/beep.c
new file mode 100755
index 0000000..cbb4ba2
--- /dev/null
+++ b/beep.c
@@ -0,0 +1,15 @@
+#include "beep.h"
+
+/*4KHz Alarm to resonate for TDK buzzer*/
+void alarm(unsigned int numberOfBeeps) {
+ for (int i = 0; i < numberOfBeeps; i++) {
+ for (int j = 0; j < 250; j++) {
+ BEEP = 1;
+ __delay_us(375);
+ BEEP = 0;
+ __delay_us(125);
+ }
+
+ __delay_ms(500);
+ }
+} \ No newline at end of file