1- Metadata-Version: 2.1
2- Name: Spectral-BLDC
3- Version: 1.18
1+ Metadata-Version: 2.4
2+ Name: Spectral_BLDC
3+ Version: 1.19
44Summary: Python module for Spectral BLDC motor controllers
55Author: Source robotics (Petar Crnjak)
66Author-email: <info@source-robotics.com>
@@ -16,20 +16,70 @@ Classifier: Operating System :: Unix
1616Classifier: Operating System :: Microsoft :: Windows
1717Description-Content-Type: text/markdown
1818License-File: LICENSE
19+ Requires-Dist: python-can
20+ Requires-Dist: pyserial
21+ Dynamic: author
22+ Dynamic: author-email
23+ Dynamic: classifier
24+ Dynamic: description
25+ Dynamic: description-content-type
26+ Dynamic: keywords
27+ Dynamic: license
28+ Dynamic: license-file
29+ Dynamic: project-url
30+ Dynamic: requires-dist
31+ Dynamic: summary
1932
2033
2134# Spectral-BLDC
2235
23- [](https://opensource.org/licenses/MIT)
36+ [](https://opensource.org/licenses/MIT)  
2437
25-
26- Python lib for controlling spectral BLDC controllers over CAN bus.
38+ Python lib for controlling [spectral BLDC](https://github.com/PCrnjak/Spectral-Micro-BLDC-controller/blob/main/README.md) controllers and [SSG-48 gripper](https://github.com/PCrnjak/SSG-48-adaptive-electric-gripper) over CAN bus.
39+ For more info about this API and all available commands check [DOCS](https://source-robotics.github.io/Spectral-BLDC-docs/apage7_can/)
2740
2841# How to install
2942
30- # How to use
43+ pip install Spectral-BLDC
44+
45+ # Basic example
46+
47+
48+ ``` py
49+ import Spectral_BLDC as Spectral
50+ import time
51+
52+
53+ Communication1 = Spectral.CanCommunication(bustype='slcan', channel='COM41', bitrate=1000000)
54+ Motor1 = Spectral.SpectralCAN(node_id=0, communication=Communication1)
55+
56+ while True:
57+
58+ Motor1.Send_Respond_Encoder_data()
59+
60+ message, UnpackedMessageID = Communication1.receive_can_messages(timeout=0.2)
61+
62+ if message is not None:
63+
64+ Motor1.UnpackData(message,UnpackedMessageID)
65+ print(f"Motor position is: {Motor1.position}")
66+ print(f"Motor speed is: {Motor1.speed}")
67+
68+ else:
69+ print("No message after timeout period!")
70+ print("")
71+ time.sleep(1 )
72+ ```
73+
74+
75+ # More examples
76+
77+ Check out the [Examples folder](https://github.com/PCrnjak/Spectral-BLDC-Python/tree/main/examples) for more examples!
78+ Available examples:
79+ * Send_respond_1
80+ * Get_encoder_data
81+ * SSG48_gripper_test
3182
32- # Examples
3383
3484
3585This project is entirely open-source and free for all to use. Any support, whether through donations or advice, is greatly appreciated. Thank you!
0 commit comments