Skip to content

Commit 00d1b32

Browse files
committed
MIDI example cleanup
1 parent 60dd5f1 commit 00d1b32

File tree

1 file changed

+3
-15
lines changed
  • libraries/Bluefruit52Lib/examples/Peripheral/blemidi

1 file changed

+3
-15
lines changed

libraries/Bluefruit52Lib/examples/Peripheral/blemidi/blemidi.ino

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ byte note_sequence[] = {
3131
56,61,64,68,74,78,81,86,90,93,98,102
3232
};
3333

34-
// Variable to hold the last time we sent a note
35-
//unsigned long previousSend = 0;
36-
3734
void setup()
3835
{
3936

@@ -77,7 +74,8 @@ void setup()
7774
// Start Advertising
7875
Bluefruit.Advertising.start();
7976

80-
Scheduler.startLoop(loop2);
77+
// Start MIDI read loop
78+
Scheduler.startLoop(midiRead);
8179
}
8280

8381
void handleNoteOn(byte channel, byte pitch, byte velocity)
@@ -106,14 +104,6 @@ void loop()
106104
return;
107105
}
108106

109-
// Store the current time
110-
// unsigned long now = millis();
111-
//
112-
// // Check if enough time has passed since last send
113-
// if (now - previousSend < 286) {
114-
// return;
115-
// }
116-
117107
// Setup variables for the current and previous
118108
// positions in the note sequence.
119109
int current = position;
@@ -141,11 +131,9 @@ void loop()
141131

142132
delay(286);
143133

144-
// Log the send time
145-
//previousSend = now;
146134
}
147135

148-
void loop2()
136+
void midiRead()
149137
{
150138
// Don't continue if we aren't connected.
151139
if (! Bluefruit.connected()) {

0 commit comments

Comments
 (0)