From 03af399f3234a5125fb6b9b54125ed0f09b279a1 Mon Sep 17 00:00:00 2001 From: Leonid Fedorenchik Date: Fri, 6 Sep 2024 16:11:17 +0800 Subject: [PATCH] Add missing return values to getters --- pymycobot/elephantrobot.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pymycobot/elephantrobot.py b/pymycobot/elephantrobot.py index f94b6f3..3ae59ba 100644 --- a/pymycobot/elephantrobot.py +++ b/pymycobot/elephantrobot.py @@ -240,17 +240,20 @@ def jog_coord(self, axis_str, direction, speed): def get_digital_in(self, pin_number): command = "get_digital_in(" + str(pin_number) + ")\n" - self.send_command(command) + res = self.send_command(command) + return self.string_to_int(res) def get_digital_out(self, pin_number): command = "get_digital_out(" + str(pin_number) + ")\n" print(command) - self.send_command(command) + res = self.send_command(command) + return self.string_to_int(res) def get_joint_current(self, joint_number): command = "get_joint_current(" + str(joint_number) + ")\n" print(command) - self.send_command(command) + res = self.send_command(command) + return self.string_to_double(res) def set_digital_out(self, pin_number, pin_signal): command = "set_digital_out(" + str(pin_number) + "," + str(pin_signal) + ")\n"