From cec5fe3f13e40cbccf9196aedaea63b335b21c32 Mon Sep 17 00:00:00 2001 From: lathoub <4082369+lathoub@users.noreply.github.com> Date: Sun, 11 Oct 2020 11:39:36 +0200 Subject: [PATCH 1/3] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 8055a56..65c68ca 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -# Experimental - # Arduino BLE-MIDI Transport This library implements the BLE-MIDI transport layer for the [FortySevenEffects Arduino MIDI Library](https://github.com/FortySevenEffects/arduino_midi_library) From 56386ace3c41a206ace8377584d80935bf177271 Mon Sep 17 00:00:00 2001 From: lathoub <4082369+lathoub@users.noreply.github.com> Date: Sun, 11 Oct 2020 11:44:25 +0200 Subject: [PATCH 2/3] Update README.md --- README.md | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 65c68ca..323b9d8 100644 --- a/README.md +++ b/README.md @@ -14,20 +14,55 @@ When manually installing this library, you have to manually download [Arduino MI #include #include ... -BLEMIDI_CREATE_DEFAULT_ESP32_INSTANCE(); +BLEMIDI_CREATE_DEFAULT_INSTANCE() ... void setup() { - MIDI.begin(1); + MIDI.begin(); ... void loop() { MIDI.read(); ``` -will create a instance named `bleMIDI` and listens to incoming MIDI on channel 1. +will create a instance named `BLEMIDI` and listens to incoming MIDI. + +### using NimBLE for ESP32 with a custom name and turns LED on when its connected + +```cpp +#include +#include +... +BLEMIDI_CREATE_INSTANCE("CustomName", MIDI) +... +void setup() +{ + pinMode(LED_BUILTIN, OUTPUT); + digitalWrite(LED_BUILTIN, LOW); + + BLEMIDI.setHandleConnected(OnConnected); + BLEMIDI.setHandleDisconnected(OnDisconnected); + + MIDI.begin(); +... +void loop() +{ + MIDI.read(); +... +void OnConnected() { + digitalWrite(LED_BUILTIN, HIGH); +} + +void OnDisconnected() { + digitalWrite(LED_BUILTIN, LOW); +} + +``` +will create a instance named `BLEMIDI` and listens to incoming MIDI. ## Tested boards/modules - ESP32 +- ESP32 NimBLE +- Arduino NANO 33 BLE ## Other Transport protocols: The libraries below the same calling mechanism (API), making it easy to interchange the transport layer. From a3206579e47c11288df810e32b56cfb88d8f528e Mon Sep 17 00:00:00 2001 From: lathoub <4082369+lathoub@users.noreply.github.com> Date: Sun, 11 Oct 2020 11:45:28 +0200 Subject: [PATCH 3/3] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 323b9d8..21dadd2 100644 --- a/README.md +++ b/README.md @@ -60,8 +60,7 @@ void OnDisconnected() { will create a instance named `BLEMIDI` and listens to incoming MIDI. ## Tested boards/modules -- ESP32 -- ESP32 NimBLE +- ESP32 (OOB BLE and NimBLE) - Arduino NANO 33 BLE ## Other Transport protocols: