Datasheet

}
void handleNoteOff(byte channel, byte pitch, byte velocity)
{
// Log when a note is released.
Serial.printf("Note off: channel = %d, pitch = %d, velocity - %d", channel, pitch, velocity);
Serial.println();
}
void loop()
{
// Don't continue if we aren't connected.
if (! Bluefruit.connected()) {
return;
}
// Don't continue if the connected device isn't ready to receive messages.
if (! blemidi.notifyEnabled()) {
return;
}
// Setup variables for the current and previous
// positions in the note sequence.
int current = position;
int previous = position - 1;
// If we currently are at position 0, set the
// previous position to the last note in the sequence.
if (previous < 0) {
previous = sizeof(note_sequence) - 1;
}
// Send Note On for current position at full velocity (127) on channel 1.
MIDI.sendNoteOn(note_sequence[current], 127, 1);
// Send Note Off for previous note.
MIDI.sendNoteOff(note_sequence[previous], 0, 1);
// Increment position
position++;
// If we are at the end of the sequence, start over.
if (position >= sizeof(note_sequence)) {
position = 0;
}
delay(286);
}
void midiRead()
{
// Don't continue if we aren't connected.
if (! Bluefruit.connected()) {
return;
}
// Don't continue if the connected device isn't ready to receive messages.
if (! blemidi.notifyEnabled()) {
return;
© Adafruit Industries https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide Page 140 of 175