@@ -37,6 +37,10 @@ def add_parameters(parameters: ParameterContext) -> None:
37
37
requirements = {"robotType" : "Flex" , "apiLevel" : "2.21" }
38
38
39
39
40
+ async def change_current (self , current : float ) -> None :
41
+ await self ._backend .set_active_current ({Axis .P_L : current })
42
+
43
+
40
44
async def read_sensor (self , sensor : EnvironmentSensor ) -> float : # noqa: ANN001
41
45
"""Read and return the current sensor information."""
42
46
s_driver = SensorDriver ()
@@ -60,6 +64,7 @@ def run(ctx: ProtocolContext) -> None:
60
64
ot3api = ctx ._core .get_hardware ()
61
65
if not ctx .is_simulating ():
62
66
OT3API .read_sensor = read_sensor # type: ignore [attr-defined]
67
+ OT3API .change_current = change_current # type: ignore [attr-defined]
63
68
primary = EnvironmentSensor .build (
64
69
sensor_id = SensorId .S0 ,
65
70
node_id = NodeId .pipette_left ,
@@ -72,6 +77,7 @@ def run(ctx: ProtocolContext) -> None:
72
77
f"flex_8channel_{ ctx .params .model_type } " , "left" # type: ignore [attr-defined]
73
78
)
74
79
if not ctx .is_simulating ():
80
+ ot3api .change_current (1.0 )
75
81
current_temp_1 = ot3api .read_sensor (primary )
76
82
current_temp_2 = ot3api .read_sensor (secondary )
77
83
get_motors_hot (ot3api ) # type: ignore [arg-type]
@@ -82,3 +88,4 @@ def run(ctx: ProtocolContext) -> None:
82
88
current_temp_2 = ot3api .read_sensor (secondary )
83
89
avg_temp = (current_temp_1 + current_temp_2 ) / 2
84
90
ctx .delay (seconds = 15 , msg = f"Current temperature { avg_temp } target={ target } " )
91
+ ot3api .change_current (0.3 )
0 commit comments