aboutsummaryrefslogtreecommitdiffstats
path: root/beep.c
blob: cbb4ba24a495820f08d0dca08764a7e7f4cfadec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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);
    }
}