Skip to content

Commit

Permalink
Update main.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
madskjeldgaard authored May 9, 2024
1 parent 18c28df commit 24e9c27
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@
#include <Adafruit_TinyUSB.h>
#include <MIDI.h>

// Smooth buttons and potentiometers, see the libraries for examples on how to use them.
#include <Bounce2.h>
#include <ResponsiveAnalogRead.h>

// USB MIDI object
Adafruit_USBD_MIDI usbMidi;
MIDI_CREATE_INSTANCE(Adafruit_USBD_MIDI, usbMidi, MIDI);

// Example of handling midi input to the device
void handle_midi_note_on(byte channel, byte note, byte velocity) {
Serial.println("Got note on!");
}

void setup() {
Serial.begin(115200);
Serial.println("Hello World!");
Expand All @@ -16,12 +25,17 @@ void setup() {
usbMidi.begin();
MIDI.begin();

// Set the MIDI note on handling function
MIDI.setHandleNoteOn(handle_midi_note_on);

pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, 1);
}

auto pastLEDState = true;
void loop() {
MIDI.read();

Serial.println("Hello from da loop!");

// Blink the LED
Expand Down

0 comments on commit 24e9c27

Please sign in to comment.