Open ghost opened 6 years ago
This is probably caused by using a different microcontroller than the default Atmel. This worked for me on a Teensy (arm)
# Board input parameters:
# int_bytes: number of bytes to store an integer
# long_bytes: number of bytes to store a long
# float_bytes: number of bytes to store a float
# double_bytes: number of bytes to store a double``
# These can be looked up here:
# https://www.arduino.cc/en/Reference/HomePage (under data types)`
arduino = PyCmdMessenger.ArduinoBoard("/dev/ttyACM0",baud_rate=9600)
teensy = PyCmdMessenger.ArduinoBoard("/dev/ttyACM0",
int_bytes=4,
baud_rate=9600)
...
# Initialize the messenger
c = PyCmdMessenger.CmdMessenger(teensy,commands)
the first exchange "who_are_you" works fine, however for the sequence
c.send("sum_two_ints",4,1) msg = c.receive()
python 3.6 throws this error on the receive line: struct.error: unpack requires a buffer of 2 bytes