Skip to content

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

Open
@nucklearproject

Description

@nucklearproject

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions