2018-03-31 16:44:44 +08:00
|
|
|
#include "buzzer.h"
|
|
|
|
|
2019-03-10 18:20:22 +08:00
|
|
|
void Ring_BEE_ONCE(uint16_t music_note) {
|
2018-03-31 16:44:44 +08:00
|
|
|
BEE_ON();
|
2019-03-10 03:34:41 +08:00
|
|
|
SpinDelayUs(music_note);
|
|
|
|
BEE_OFF();
|
|
|
|
SpinDelayUs(music_note);
|
2018-03-31 16:44:44 +08:00
|
|
|
}
|
|
|
|
|
2019-03-10 18:20:22 +08:00
|
|
|
void ring_2_7khz(uint16_t count) {
|
2019-03-10 07:00:59 +08:00
|
|
|
Ring_BEE_TIME(n_2_7khz, count);
|
2018-03-31 16:44:44 +08:00
|
|
|
}
|
|
|
|
|
2019-03-10 18:20:22 +08:00
|
|
|
void Ring_BEE_TIME(uint16_t music_note, uint16_t count) {
|
2019-03-10 07:00:59 +08:00
|
|
|
for (uint16_t i = 0 ; i < count; i++)
|
2019-03-10 03:34:41 +08:00
|
|
|
Ring_BEE_ONCE(music_note);
|
|
|
|
SpinDelay(9);
|
2018-03-31 16:44:44 +08:00
|
|
|
}
|
|
|
|
|
2019-03-10 18:20:22 +08:00
|
|
|
void Ring_ALL(uint16_t count) {
|
2019-03-10 07:00:59 +08:00
|
|
|
Ring_BEE_TIME(note_1, count);
|
|
|
|
Ring_BEE_TIME(note_2, count);
|
|
|
|
Ring_BEE_TIME(note_3, count);
|
|
|
|
Ring_BEE_TIME(note_4, count);
|
|
|
|
Ring_BEE_TIME(note_5, count);
|
|
|
|
Ring_BEE_TIME(note_6, count);
|
|
|
|
Ring_BEE_TIME(note_7, count);
|
|
|
|
SpinDelay(10);
|
2018-03-31 16:44:44 +08:00
|
|
|
}
|
|
|
|
|
2019-03-10 18:20:22 +08:00
|
|
|
void Ring_Little_Star(uint16_t count) {
|
2019-03-10 07:00:59 +08:00
|
|
|
Ring_BEE_TIME(note_1, count);
|
|
|
|
Ring_BEE_TIME(note_1, count);
|
|
|
|
Ring_BEE_TIME(note_5, count);
|
|
|
|
Ring_BEE_TIME(note_5, count);
|
|
|
|
Ring_BEE_TIME(note_6, count);
|
|
|
|
Ring_BEE_TIME(note_6, count);
|
|
|
|
Ring_BEE_TIME(note_5, 2 * count);
|
2019-03-10 03:34:41 +08:00
|
|
|
LED_A_ON();
|
|
|
|
/*
|
|
|
|
Ring_BEE_TIME(note_4,count);
|
|
|
|
Ring_BEE_TIME(note_4,count);
|
|
|
|
Ring_BEE_TIME(note_3,count);
|
|
|
|
Ring_BEE_TIME(note_3,count);
|
|
|
|
Ring_BEE_TIME(note_2,count);
|
|
|
|
Ring_BEE_TIME(note_2,count);
|
|
|
|
Ring_BEE_TIME(note_1,2*count);
|
|
|
|
LED_A_OFF();
|
2018-03-31 16:44:44 +08:00
|
|
|
|
2019-03-10 03:34:41 +08:00
|
|
|
Ring_BEE_TIME(note_5,count);
|
|
|
|
Ring_BEE_TIME(note_5,count);
|
|
|
|
Ring_BEE_TIME(note_4,count);
|
|
|
|
Ring_BEE_TIME(note_4,count);
|
|
|
|
Ring_BEE_TIME(note_3,count);
|
|
|
|
Ring_BEE_TIME(note_3,count);
|
|
|
|
Ring_BEE_TIME(note_2,2*count);
|
|
|
|
LED_A_ON();
|
2018-03-31 16:44:44 +08:00
|
|
|
|
2019-03-10 03:34:41 +08:00
|
|
|
Ring_BEE_TIME(note_5,count);
|
|
|
|
Ring_BEE_TIME(note_5,count);
|
|
|
|
Ring_BEE_TIME(note_4,count);
|
|
|
|
Ring_BEE_TIME(note_4,count);
|
|
|
|
Ring_BEE_TIME(note_3,count);
|
|
|
|
Ring_BEE_TIME(note_3,count);
|
|
|
|
Ring_BEE_TIME(note_2,2*count);
|
|
|
|
LED_A_OFF();
|
2018-03-31 16:44:44 +08:00
|
|
|
|
2019-03-10 03:34:41 +08:00
|
|
|
Ring_BEE_TIME(note_1,count);
|
|
|
|
Ring_BEE_TIME(note_1,count);
|
|
|
|
Ring_BEE_TIME(note_5,count);
|
|
|
|
Ring_BEE_TIME(note_5,count);
|
|
|
|
Ring_BEE_TIME(note_6,count);
|
|
|
|
Ring_BEE_TIME(note_6,count);
|
|
|
|
Ring_BEE_TIME(note_5,2*count);
|
|
|
|
LED_A_ON();
|
2018-03-31 16:44:44 +08:00
|
|
|
|
2019-03-10 03:34:41 +08:00
|
|
|
Ring_BEE_TIME(note_4,count);
|
|
|
|
Ring_BEE_TIME(note_4,count);
|
|
|
|
Ring_BEE_TIME(note_3,count);
|
|
|
|
Ring_BEE_TIME(note_3,count);
|
|
|
|
Ring_BEE_TIME(note_2,count);
|
|
|
|
Ring_BEE_TIME(note_2,count);
|
|
|
|
Ring_BEE_TIME(note_1,2*count);
|
|
|
|
LED_B_ON();
|
|
|
|
*/
|
2019-03-12 07:12:26 +08:00
|
|
|
}
|