Closed risq closed 1 year ago
I have no idea what library you're using for MIDI
or what it's doing behind the scenes, but justby inspection it seems you have not set the Serial1.setRX()
pin to something not overlapping your Wire
and hence, when Serial1.begin(xxx)
is called the shared Wire/Serial GPIO is redirected from Wire to Serial1. I suggest adding a setRX()
to some legal, unused pin.
You are right ! I don't know I could not see it... Indeed I only use MIDI out so I don't use Serial RX at all, but I totally forgot to change it. Thanks a lot.
PS : sorry for not having linked the MIDI library I use. For the record, here it is : arduino_midi_library and the relevant file : https://github.com/FortySevenEffects/arduino_midi_library/blob/master/src/serialMIDI.h#L56
Hello,
I just resolved a problem with an i2c device but I don't understand why my initial code did not work. Sorry in advance if this is the expeded behavior or if this is not linked to arduino-pico core but I would like to be sure that I did everything right. And maybe this could help someone who would have the same problem in the future.
Here is a simplified version of my code :
Here by investigating a little I got a Wire error 4 (
other twi error (lost bus arbitration, bus error, ..)
). I finally found that removing MIDI initialization line would fix the issue. As Serial1 default TX pin is GP0 it looks that it is interfering with i2c on the same pin, even if TX pin was changed before begining MIDI transmission. How is it possible ?The only way I found to make it work was to move my Wire initialization code after MIDI initialization. Is it the expected behavior ?
Thanks for the clarification.