26 lines
623 B
C++
26 lines
623 B
C++
// NoteButton — sends Note On/Off on button press/release.
|
|
// Original: examples/1. MIDI Output/2. Buttons & Switches/1. Momentary Push Buttons/NoteButton/NoteButton.ino
|
|
|
|
#include "pico/stdlib.h"
|
|
#include "pico/cyw43_arch.h"
|
|
#include <cs_midi.h>
|
|
|
|
using namespace cs;
|
|
|
|
BluetoothMIDI_Interface midi;
|
|
|
|
NoteButton button {
|
|
5, // push button on GPIO 5
|
|
{MIDI_Notes::C[4], Channel_1}, // note C4, channel 1
|
|
};
|
|
|
|
int main() {
|
|
stdio_init_all();
|
|
if (cyw43_arch_init()) return 1;
|
|
Control_Surface.begin();
|
|
while (true) {
|
|
Control_Surface.loop();
|
|
sleep_ms(1);
|
|
}
|
|
}
|