IoT - Modular - Noise.cpp

From The TinkerNet Wiki
Revision as of 23:06, 29 April 2021 by Tinker (talk | contribs) (Created page with "==#includes, Defines, etc...== <syntaxhighlight lang="cpp" line="1"> #include "libraries.h" #include "functions.h" #include "Noise.h" </syntaxhighlight> ==Noise_init()== <s...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

#includes, Defines, etc...

1 #include "libraries.h"
2 #include "functions.h"
3 #include "Noise.h"

Noise_init()

1 void Noise_init()
2 {
3   char debugTEXT[46];
4 
5   debug_SectionTitle("Configuring Audio");
6     sprintf(debugTEXT, "Configured speaker/piezo on pin %d", piezoPin);
7   debug_LineOut(debugTEXT);
8 }

ScreamBloodyMurder()

 1 void ScreamBloodyMurder()
 2 {
 3     for (int counter = 0; counter < 5; counter++)
 4     {
 5         tone(piezoPin, 666);
 6         delay(500);
 7         noTone(piezoPin);
 8         tone(piezoPin, 333);
 9         delay(500);
10         noTone(piezoPin);
11     }
12     debug_Action("Holy POOP!  The Pumphouse is gonna flood!");
13 }

STFU()

1 void STFU()
2 {
3     noTone(piezoPin);
4 }

Boop()

1 void Boop()
2 {
3     tone(piezoPin, 111);
4         debug_Action("BOOP!");
5         delay(125);
6         noTone(piezoPin);
7 }