m-laniakea / st_spin

A Python library for interfacing with ST Spin Family devices, specifically the ST Micro L6470, L6472, L6474, and L6480 ICs.
MIT License
5 stars 2 forks source link

README.md fails with several errors #3

Closed redshiva closed 4 years ago

redshiva commented 4 years ago

Something is really wrong. The README.md sample code fails with several errors. I worked around all of those, then I hit the same error as another user: File "/usr/local/lib/python3.7/dist-packages/stspin/spin_device.py", line 135, in move self._writeCommand(Command.Move | self._direction, steps, PayloadSize) TypeError: unsupported operand type(s) for |: 'int' and 'SpinValue'

Command.Move, an integer, can't be "|" with an object "self._direction". So I then looked at the typedef branch and see you changed the code around:

command = (Command.Move | self._direction).setPayload(steps) self._writeCommand(command)

Is there a missing commit to the dev branch? You code is amazing and I would really like to use is for my project. Any insights would be greatly appreciated.

m-laniakea commented 4 years ago

Same issue as https://github.com/m-laniakea/st_spin/issues/1 and https://github.com/m-laniakea/st_spin/issues/2

This was my fault, because I ended up working on something else abruptly, but forgot the examples were no longer up-to-date.

Thank you for the compliment, and the examples should work now.