Viking Skull Lamp  V1.0.1
Loading...
Searching...
No Matches
buzzerControl.hpp
Go to the documentation of this file.
1/*
2 * Created on May 28 2022
3 *
4 * Copyright (c) 2022 - Daniel Hajnal
5 * hajnal.daniel96@gmail.com
6 * This file is part of the Viking Skull Lamp project.
7 * Modified 2022.06.27
8*/
9
10/*
11MIT License
12Copyright (c) 2022 Daniel Hajnal
13Permission is hereby granted, free of charge, to any person obtaining a copy
14of this software and associated documentation files (the "Software"), to deal
15in the Software without restriction, including without limitation the rights
16to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17copies of the Software, and to permit persons to whom the Software is
18furnished to do so, subject to the following conditions:
19The above copyright notice and this permission notice shall be included in all
20copies or substantial portions of the Software.
21THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27SOFTWARE.
28*/
29
30#ifndef BUZZER_CONTROL_HPP__
31#define BUZZER_CONTROL_HPP__
32
33#include "Arduino.h"
34#include "menu.hpp"
35
37#define SPEAKER_PIN 9
38
40#define BUTTON_CLICK_FREQUENCY 1000
42#define BUTTON_CLICK_DURATION 20
43
45#define ENCODER_ROTATE_FREQUENCY 5000
47#define ENCODER_ROTATE_DURATION 15
48
50#define TURN_ON_SOUND_FREQUENCY 1800
52#define TURN_ON_SOUND_DURATION 30
53
54// Frequency of notes.
55#define NOTE_B0 31
56#define NOTE_C1 33
57#define NOTE_CS1 35
58#define NOTE_D1 37
59#define NOTE_DS1 39
60#define NOTE_E1 41
61#define NOTE_F1 44
62#define NOTE_FS1 46
63#define NOTE_G1 49
64#define NOTE_GS1 52
65#define NOTE_A1 55
66#define NOTE_AS1 58
67#define NOTE_B1 62
68#define NOTE_C2 65
69#define NOTE_CS2 69
70#define NOTE_D2 73
71#define NOTE_DS2 78
72#define NOTE_E2 82
73#define NOTE_F2 87
74#define NOTE_FS2 93
75#define NOTE_G2 98
76#define NOTE_GS2 104
77#define NOTE_A2 110
78#define NOTE_AS2 117
79#define NOTE_B2 123
80#define NOTE_C3 131
81#define NOTE_CS3 139
82#define NOTE_D3 147
83#define NOTE_DS3 156
84#define NOTE_E3 165
85#define NOTE_F3 175
86#define NOTE_FS3 185
87#define NOTE_G3 196
88#define NOTE_GS3 208
89#define NOTE_A3 220
90#define NOTE_AS3 233
91#define NOTE_B3 247
92#define NOTE_C4 262
93#define NOTE_CS4 277
94#define NOTE_D4 294
95#define NOTE_DS4 311
96#define NOTE_E4 330
97#define NOTE_F4 349
98#define NOTE_FS4 370
99#define NOTE_G4 392
100#define NOTE_GS4 415
101#define NOTE_A4 440
102#define NOTE_AS4 466
103#define NOTE_B4 494
104#define NOTE_C5 523
105#define NOTE_CS5 554
106#define NOTE_D5 587
107#define NOTE_DS5 622
108#define NOTE_E5 659
109#define NOTE_F5 698
110#define NOTE_FS5 740
111#define NOTE_G5 784
112#define NOTE_GS5 831
113#define NOTE_A5 880
114#define NOTE_AS5 932
115#define NOTE_B5 988
116#define NOTE_C6 1047
117#define NOTE_CS6 1109
118#define NOTE_D6 1175
119#define NOTE_DS6 1245
120#define NOTE_E6 1319
121#define NOTE_F6 1397
122#define NOTE_FS6 1480
123#define NOTE_G6 1568
124#define NOTE_GS6 1661
125#define NOTE_A6 1760
126#define NOTE_AS6 1865
127#define NOTE_B6 1976
128#define NOTE_C7 2093
129#define NOTE_CS7 2217
130#define NOTE_D7 2349
131#define NOTE_DS7 2489
132#define NOTE_E7 2637
133#define NOTE_F7 2794
134#define NOTE_FS7 2960
135#define NOTE_G7 3136
136#define NOTE_GS7 3322
137#define NOTE_A7 3520
138#define NOTE_AS7 3729
139#define NOTE_B7 3951
140#define NOTE_C8 4186
141#define NOTE_CS8 4435
142#define NOTE_D8 4699
143#define NOTE_DS8 4978
144
150void buttonClickSound();
151
157void encoderRotateSound();
158
166void turnOnMelody();
167
171void openCloseMelody();
172
176void clapMelody();
177
178#endif
void encoderRotateSound()
Generate encoder rotate sound.
void turnOnMelody()
Generate turn on sound.
void buttonClickSound()
Generate button click sound.
void openCloseMelody()
Generate open-close melody.
void clapMelody()
Generate clap melody.