Trinamic StepRocker stepper motor drivers
Python module forThis software is not associated with Trinamic. Use it at your own risk.
Info
The code here is released under the MIT license.
Python TMCL Interface for the StepRocker stepper motor driver
License: MIT License
This software is not associated with Trinamic. Use it at your own risk.
The code here is released under the MIT license.
Under which license is this code released? We would like to ship it with the next Mission Pinball Framework release to support the steprocker. We are currently releasing our code under the MIT license. So MIT would be perfect for us. Alternatively, we could use any library license such as LGPL but we might have to ship it as separate pypi package. What do you think?
PyStepRocker is fantastic...thank you for creating it.
While using it, I noticed that TMCL.py has two bugs inside class TMCLDevice.
The following two method definitions are missing the "self" parameter:
def sio(port_number, state):
...
def gio(port_number, bank_number):
So the above should read:
def sio(self, port_number, state):
...
def gio(self, port_number, bank_number):
Thanks!
Inside TMCL.py, CMD_MVP_TYPES has key of 'COORDS' rather than 'COORD'. The result is that the method "mvp" does not work since it is expecting 'COORD'. Also, the Trinamic documentation uses 'COORD' (not 'COORDS'), so changing to 'COORD' provides consistency with the Trinamic implementation.
Suggest changing the following portion:
CMD_MVP_TYPES = {'ABS': 0,
'REL': 1,
'COORDS': 2}
To this:
CMD_MVP_TYPES = {'ABS': 0,
'REL': 1,
'COORD': 2}
Inside TMCL.py, there is a logic bug hidden in the method function "gio" within class TMCLDevice:
Currently, the code is:
if bank == 0 and not (0 <= outp <= 3):
raise TMCLError("GIO: output_number not in range(4) @ bank0")
elif bank == 1 and not (0 <= outp <= 2):
raise TMCLError("GIO: output_number not in range(3) @ bank1")
elif bank == 2 and not (0 <= outp <= 4):
raise TMCLError("GIO: output_number not in range(5) @ bank2")
else:
raise TMCLError("GIO: bank_number not in range(3)")
...but the above code will erroneously fail if gio is called with:
gio(2,2)
...the above (erroneously) returns "GIO: bank_number not in range(3)" because the following condition will be false:
elif bank == 2 and not (0 <= outp <= 4)
...and then it will fall through to execute the else clause, even though bank=2 and outp=2 (a valid case).
I would recommend refactoring this block to the following, to break up the "and" statements to get it working properly:
if bank == 0:
if not (0 <= outp <= 3):
raise TMCLError("GIO: output_number not in range(4) @ bank0")
elif bank == 1:
if not (0 <= outp <= 2):
raise TMCLError("GIO: output_number not in range(3) @ bank1")
elif bank == 2:
if not (0 <= outp <= 4):
raise TMCLError("GIO: output_number not in range(5) @ bank2")
else:
raise TMCLError("GIO: bank_number not in range(3)")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.