Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is correct this modification for work in a raspberry Pi? #55

Open
nucklearproject opened this issue Sep 16, 2023 · 0 comments
Open

Is correct this modification for work in a raspberry Pi? #55

nucklearproject opened this issue Sep 16, 2023 · 0 comments

Comments

@nucklearproject
Copy link

nucklearproject commented Sep 16, 2023

Hi, I use my raspberry Pi B+ for sending data for serial UART port. TX pin

uart = serial.Serial(port='/dev/ttyAMA0', baudrate=31250)

midi = adafruit_midi.MIDI(midi_out= uart, out_channel=0, debug=True)`

But this error appear:

 File "/home/raspbi/.local/lib/python3.9/site-packages/adafruit_midi/__init__.py", line 171, in _send
    self._midi_out.write(packet, num)

TypeError: write() takes 2 positional arguments but 3 were given`

Work fine if delete 'num' argument..

Change this

def _send(self, packet, num):
        if self._debug:
            print("Sending: ", [hex(i) for i in packet[:num]])
        self._midi_out.write(packet, num)

To

def _send(self, packet, num):
        if self._debug:
            print("Sending: ", [hex(i) for i in packet[:num]])
        self._midi_out.write(packet)

It is correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant