diff options
Diffstat (limited to 'beep.c')
-rwxr-xr-x | beep.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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 |