Control Surface  1.1.0
MIDI Control Surface library for Arduino
CCButton.hpp
Go to the documentation of this file.
1 #pragma once
2 
5 
7 
8 /**
9  * @brief A class of MIDIOutputElement%s that read the input of a **momentary
10  * push button or switch**, and send out MIDI **Control Change**
11  * events.
12  *
13  * A value of 0x7F is sent when the button is pressed, and a value of
14  * 0x00 is sent when the button is released.
15  * The button is debounced in software.
16  * This version cannot be banked.
17  *
18  * @ingroup MIDIOutputElements
19  */
20 class CCButton
21  : public MIDIButton<DigitalCCSender> {
22  public:
23  /**
24  * @brief Create a new CCButton object with the given pin,
25  * the given controller number and channel.
26  *
27  * @param pin
28  * The digital input pin with the button connected.
29  * The internal pull-up resistor will be enabled.
30  * @param address
31  * The MIDI address containing the controller number [0, 119],
32  * channel [CHANNEL_1, CHANNEL_16], and optional cable number
33  * [0, 15].
34  * @param sender
35  * The MIDI sender to use.
36  */
38  : MIDIButton(pin, address, sender) {}
39 };
40 
DigitalCCSender.hpp
CCButton::CCButton
CCButton(pin_t pin, const MIDICNChannelAddress &address, const DigitalCCSender &sender={})
Create a new CCButton object with the given pin, the given controller number and channel.
Definition: CCButton.hpp:37
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition: Settings/NamespaceSettings.hpp:9
DigitalCCSender
Definition: DigitalCCSender.hpp:7
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition: Settings/NamespaceSettings.hpp:10
MIDIButton< DigitalCCSender >::sender
DigitalCCSender sender
Definition: Abstract/MIDIButton.hpp:55
MIDIButton
An abstract class for momentary push buttons that send MIDI events.
Definition: Abstract/MIDIButton.hpp:17
MIDIButton< DigitalCCSender >::address
const MIDICNChannelAddress address
Definition: Abstract/MIDIButton.hpp:52
MIDICNChannelAddress
A type-safe utility class for saving a MIDI address consisting of a 7-bit address,...
Definition: MIDICNChannelAddress.hpp:82
CCButton
A class of MIDIOutputElements that read the input of a momentary push button or switch,...
Definition: CCButton.hpp:20
AH::pin_t
uint16_t pin_t
The type for Arduino pins (and ExtendedIOElement pins).
Definition: Hardware-Types.hpp:17
MIDIButton< DigitalCCSender >::MIDIButton
MIDIButton(pin_t pin, const MIDICNChannelAddress &address, const DigitalCCSender &sender)
Construct a new MIDIButton.
Definition: Abstract/MIDIButton.hpp:30
MIDIButton.hpp