FortySevenEffects / arduino_midi_library

MIDI for Arduino
MIT License
1.56k stars 252 forks source link

MIDI on ESP8266 Wemos D1 Mini #344

Closed undercurrent77 closed 3 months ago

undercurrent77 commented 3 months ago

Context

Please answer a few questions to help us understand your problem better and guide you to a solution:

Describe your project and what you expect to happen:

I've followed along with the example found on the Notes and Volts video found here: https://www.youtube.com/watch?v=rmfAqg9O_os&list=PL4_gPbvyebyH2xfPXePHtx8gK5zPBrVkg&index=5

When I upload the code to my arduino uno rev 3, everything works as expected. I'm using the morningstar midi monitor website and am seeing note 60 turn on and off. However, when I upload the same code to my wemos d1 mini esp8266 nothing happens. The builtin led blinks, so the code has uploaded properly but I don't see any midi messages being transmitted. I have the data line for the serial midi plugged into the TX pin on GPIO1.

Here is my code:


#include <MIDI.h>

MIDI_CREATE_DEFAULT_INSTANCE();

void setup() 
{
  pinMode(LED_BUILTIN, OUTPUT);
  MIDI.begin(MIDI_CHANNEL_OFF);
}

void loop() 
{
  digitalWrite(LED_BUILTIN, HIGH);
  MIDI.sendNoteOn(60, 127, 1);
  delay(1000);
  MIDI.sendNoteOff(60, 0, 1);
  digitalWrite(LED_BUILTIN, LOW);
  delay(2000);
}

-->

## Describe your problem (what does not work):

Midi code works on Arduino Uno rev 3 but not wemos D1 mini esp8266
undercurrent77 commented 3 months ago

Total brain cramp on my part. The logic level of the RT and TX pins are 3.3v on the D1 Mini even though it has the 5V output on the board. Used a level shifter and the code worked as expected.