Merge pull request #1766 from meshtastic/new-sounds

use F# as startup and shutdown sound triple
This commit is contained in:
Thomas Göttgens 2022-10-07 19:16:50 +02:00 committed by GitHub
commit f4945729bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,6 +36,7 @@ struct ToneDuration {
#define NOTE_A3 220 #define NOTE_A3 220
#define NOTE_AS3 233 #define NOTE_AS3 233
#define NOTE_B3 247 #define NOTE_B3 247
#define NOTE_CS4 277
const int DURATION_1_8 = 125; // 1/8 note const int DURATION_1_8 = 125; // 1/8 note
const int DURATION_1_4 = 250; // 1/4 note const int DURATION_1_4 = 250; // 1/4 note
@ -65,16 +66,17 @@ void playBeep() { tone(PIN_BUZZER, NOTE_B3, DURATION_1_4); }
#endif #endif
void playStartMelody() { void playStartMelody() {
ToneDuration melody[] = {{NOTE_B3, DURATION_1_4}, ToneDuration melody[] = {{NOTE_FS3, DURATION_1_8},
{NOTE_B3, DURATION_1_8}, {NOTE_AS3, DURATION_1_8},
{NOTE_B3, DURATION_1_8}}; {NOTE_CS4, DURATION_1_4}};
playTones(melody, sizeof(melody) / sizeof(ToneDuration)); playTones(melody, sizeof(melody) / sizeof(ToneDuration));
} }
void playShutdownMelody() { void playShutdownMelody() {
ToneDuration melody[] = {{NOTE_B3, DURATION_1_4}, ToneDuration melody[] = {{NOTE_CS4, DURATION_1_8},
{NOTE_G3, DURATION_1_8}, {NOTE_AS3, DURATION_1_8},
{NOTE_D3, DURATION_1_8}}; {NOTE_FS3, DURATION_1_4}};
playTones(melody, sizeof(melody) / sizeof(ToneDuration)); playTones(melody, sizeof(melody) / sizeof(ToneDuration));
} }
#endif #endif