diff --git a/CHANGELOG.md b/CHANGELOG.md index e73ff3f..cd5ed6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # ChangeLog for pymycobot +## v3.0.8 (2023-04-14) + +- release v3.0.8 +- Fix Mybuddy GPIO control bug + ## v3.0.7 (2023-03-06) - release v3.0.7 diff --git a/pymycobot/__init__.py b/pymycobot/__init__.py index 9dc226a..12e25c8 100644 --- a/pymycobot/__init__.py +++ b/pymycobot/__init__.py @@ -43,7 +43,7 @@ from pymycobot.mybuddyemoticon import MyBuddyEmoticon __all__.append("MyBuddyEmoticon") -__version__ = "3.0.8b1" +__version__ = "3.0.8" __author__ = "Elephantrobotics" __email__ = "weiquan.xu@elephantrobotics.com" __git_url__ = "https://github.com/elephantrobotics/pymycobot" diff --git a/pymycobot/mybuddy.py b/pymycobot/mybuddy.py index d4d2812..bd74e6e 100644 --- a/pymycobot/mybuddy.py +++ b/pymycobot/mybuddy.py @@ -263,9 +263,9 @@ def set_gpio_setup(self, pin_no, mode): """ pin_no = self.base_io_to_gpio(pin_no) if mode == 1: - self.gpio.setup(pin_no, self.gpio.OUT, initial=self.gpio.HIGH) + self.gpio.setup(pin_no, self.gpio.OUT) else: - self.gpio.setup(pin_no, self.gpio.IN, pull_up_down=self.gpio.DOWN) + self.gpio.setup(pin_no, self.gpio.IN) def set_gpio_output(self, pin_no, v): """Set GPIO output value. @@ -284,7 +284,7 @@ def get_gpio_input(self, pin_no): pin_no: (int)pin number 1-16. """ pin = self.base_io_to_gpio(pin_no) - self.gpio.input(pin) + return self.gpio.input(pin) def set_gpio_pwm_start(self, pin_no, freq = 0.5, dc = 0.5): """Set GPIO PWM value.