36 lines
676 B
Markdown
36 lines
676 B
Markdown
# NoteButtonMatrix
|
|
|
|
Grid of note buttons using row/column scanning.
|
|
|
|
> Original: `NoteButtonMatrix.ino`
|
|
|
|
```cpp
|
|
#include "pico/stdlib.h"
|
|
#include "pico/cyw43_arch.h"
|
|
#include <cs_midi.h>
|
|
|
|
using namespace cs;
|
|
|
|
BluetoothMIDI_Interface midi;
|
|
|
|
NoteButtonMatrix<2, 3> matrix {
|
|
{0, 1}, // row pins
|
|
{2, 3, 4}, // column pins
|
|
{{
|
|
{MIDI_Notes::C[4], MIDI_Notes::D[4], MIDI_Notes::E[4]},
|
|
{MIDI_Notes::F[4], MIDI_Notes::G[4], MIDI_Notes::A[4]},
|
|
}},
|
|
Channel_1,
|
|
};
|
|
|
|
int main() {
|
|
stdio_init_all();
|
|
if (cyw43_arch_init()) return 1;
|
|
Control_Surface.begin();
|
|
while (true) {
|
|
Control_Surface.loop();
|
|
sleep_ms(1);
|
|
}
|
|
}
|
|
```
|