Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
jackparmer authored and itsjoeoui committed Oct 16, 2023
1 parent c307251 commit 948a6d7
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from tinymovr.tee import init_tee, destroy_tee
from tinymovr.config import get_bus_config, create_device


@flojoy(deps={"tinymovr": "1.6.2"})
def TINYMOVR_CALIBRATE() -> TextBlob:
"""Discover and calibrate a connected tinymovr BLDC driver through a CANine USB-to-CAN controller.
Expand All @@ -21,7 +22,7 @@ def TINYMOVR_CALIBRATE() -> TextBlob:
bitrate = 1000000
params = get_bus_config(["canine", "slcan_disco"])
params["bitrate"] = bitrate
tb = ''
tb = ""

try:
with can.Bus(**params) as bus:
Expand All @@ -32,4 +33,4 @@ def TINYMOVR_CALIBRATE() -> TextBlob:
except:
tb = traceback.format_exc()

return TextBlob(text_blob = tb)
return TextBlob(text_blob=tb)
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
from tinymovr.tee import init_tee, destroy_tee
from tinymovr.config import get_bus_config, create_device


@flojoy(deps={"tinymovr": "1.6.2"})
def TINYMOVR_SET_VELOCITY(
default: Scalar
) -> TextBlob:
def TINYMOVR_SET_VELOCITY(default: Scalar) -> TextBlob:
"""Direct a tinymovr BLDC driver to a set velocity.
Input
Expand All @@ -22,7 +21,7 @@ def TINYMOVR_SET_VELOCITY(
Traceback error (if any)
"""

tb = ''
tb = ""
bitrate = 1000000
params = get_bus_config(["canine", "slcan_disco"])
params["bitrate"] = bitrate
Expand All @@ -35,7 +34,7 @@ def TINYMOVR_SET_VELOCITY(
try:
# Connect to servo over CAN network
# TODO: Consider saving Avlos tm Python object in HW device context manager
# Reference: https://github.com/tinymovr/avlos
# Reference: https://github.com/tinymovr/avlos
with can.Bus(**params) as bus:
init_tee(bus)
tm = create_device(node_id=1)
Expand All @@ -45,4 +44,4 @@ def TINYMOVR_SET_VELOCITY(
except:
tb = traceback.format_exc()

return TextBlob(text_blob = tb)
return TextBlob(text_blob=tb)
49 changes: 17 additions & 32 deletions IO/MOTION/MOTOR_DRIVERS/STEPPER/POLULU/TIC/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,65 +17,50 @@
"default": 30,
"functionName": "STEPPER_DRIVER_TIC",
"param": "current_limit",
"value": 30
"value": 30,
},
"sleep_time": {
"type": "int",
"default": 2,
"functionName": "STEPPER_DRIVER_TIC",
"param": "sleep_time",
"value": 2
"value": 2,
},
"speed": {
"type": "int",
"default": 100000,
"functionName": "STEPPER_DRIVER_TIC",
"param": "speed",
"value": 100000
}
"value": 100000,
},
},
"inputs": [
{
"name": "default",
"id": "default",
"type": "OrderedPair",
"multiple": false
"multiple": false,
}
],
"outputs": [
{
"name": "default",
"id": "default",
"type": "OrderedPair"
}
],
"pip_dependencies": [
{
"name": "ticlib",
"v": "0.2.2"
}
{"name": "default", "id": "default", "type": "OrderedPair"}
],
"pip_dependencies": [{"name": "ticlib", "v": "0.2.2"}],
"path": "PYTHON/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/STEPPER_DRIVER_TIC.py",
"selected": false
},
"position": {
"x": 883.1245033729516,
"y": -2.309719518942927
"selected": false,
},
"position": {"x": 883.1245033729516, "y": -2.309719518942927},
"selected": false,
"positionAbsolute": {
"x": 883.1245033729516,
"y": -2.309719518942927
},
"dragging": true
"positionAbsolute": {"x": 883.1245033729516, "y": -2.309719518942927},
"dragging": true,
}
],
"edges": [],
"viewport": {
"x": -358.59636577932724,
"y": 99.85117439980638,
"zoom": 1.0581352782820395
}
"zoom": 1.0581352782820395,
},
},
"ctrlsManifest": [
{
Expand All @@ -92,8 +77,8 @@
"w": 2,
"minH": 1,
"minW": 2,
"i": "INPUT_PLACEHOLDER"
}
"i": "INPUT_PLACEHOLDER",
},
}
]
}
],
}
2 changes: 1 addition & 1 deletion IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/CAN_MESSAGE.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def CAN_MESSAGE(
s = json.dumps(can.rc)

msg = can.Message(
data = message.v, arbitration_id=0xC0FFEE, is_extended_id=is_extended_id
data=message.v, arbitration_id=0xC0FFEE, is_extended_id=is_extended_id
)

with can.Bus() as bus:
Expand Down

0 comments on commit 948a6d7

Please sign in to comment.