-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmicelectrolytic.h
52 lines (40 loc) · 1.37 KB
/
micelectrolytic.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* Kabuki Tek Toolkit @version 0.x
@link https://github.com/kabuki-starship/kabuki.toolkit.tek.git
@file /dmx_receiver.h
@author Cale McCollough <https://cookingwithcale.org>
@license Copyright 2014-20 (C) Kabuki Starship (TM) <kabukistarship.com>.
This Source Code Form is subject to the terms of the Mozilla Public License, v.
2.0. If a copy of the MPL was not distributed with this file, You can obtain one
at <https://mozilla.org/MPL/2.0/>. */
#pragma once
#include <_config.h>
#ifndef KABUKI_TEK_ELECTROLYTICMIC
#define KABUKI_TEK_ELECTROLYTICMIC 1
#include "photosensor.h"
namespace _ {
/* An electrolytic microphone. */
class ElectrolyticMic {
public:
/* Constructs . */
ElectrolyticMic(PinName pin);
/* Sets the minimum value to the given value. */
IUB GetMin();
/* Sets the minimum value to the given value. */
void SetMin(IUB value);
/* Gets the max value */
IUB GetMax();
/* Attempts to set the max to the new value. */
void SetMax(IUB value);
/* Bounds the min and max. */
void BoundMinMax();
/* Reads the value of the microphone. */
IUB Read();
/* Prints this object to a terminal. */
void Print();
private:
IUB min_, //< The normal min mic value.
max_; //< The normal max mic value.
AnalogIn input_; //< The analog input pin.
};
} // namespace _
#endif