diff --git a/pymycobot/README.md b/pymycobot/README.md index 1ad9443..f4f28b7 100644 --- a/pymycobot/README.md +++ b/pymycobot/README.md @@ -63,6 +63,8 @@ We support Python2, Python3.5 or later. * [set_gripper_value](#set_gripper_value) * [set_gripper_ini](#set_gripper_ini) * [is_gripper_moving](#is_gripper_moving) + * [Basic](#basic) + * [set_basic_output](#set_basic_output) * [Angle](#angle) * [Coord](#coord) @@ -605,6 +607,19 @@ from pymycobot.mycobot import MyCobot - `1` : is moving - `-1`: error data +## Basic + +### set_basic_output + +- **Prototype**: `set_basic_output(pin_no, pin_signal)` + +- **Description**: Set bottom pin. + +- **Parameters** + + - `pin_no` (`int`) Pin number. + - `pin_signal` (`int`): 0 / 1 + # Angle ```python diff --git a/tests/test_api.py b/tests/test_api.py index 68bfecd..a521a70 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -103,7 +103,7 @@ def test_jog(setup): mc.pause() time.sleep(3) - print(mc.is_paused()) # FIXME: + print(mc.is_paused()) # FIXME: print("speed get", mc.get_speed()) mc.set_speed(20) print("speed set", mc.get_speed()) @@ -111,7 +111,7 @@ def test_jog(setup): time.sleep(6) print("resume") - mc.resume() # FIXME: + mc.resume() # FIXME: time.sleep(10) coords = [160, 140, 160, 0, 0, 0] @@ -136,7 +136,7 @@ def test_state_control(setup): time.sleep(4) print("is moving: 1 - true, 0 - false") - print(mc.is_moving()) # FIXME: + print(mc.is_moving()) # FIXME: time.sleep(1) mc.jog_angle(1, 1, 10) time.sleep(1) @@ -247,6 +247,26 @@ def test_io(setup): mc.set_digital_output(19, 0) +def test_pump(setup): + print("==========================================================") + print("Start Pump test...") + + def pump_on(): + mc.set_basic_output(2, 0) + mc.set_basic_output(5, 0) + + def pump_off(): + mc.set_basic_output(2, 1) + mc.set_basic_output(5, 1) + + pump_off() + time.sleep(3) + pump_on() + time.sleep(3) + pump_off() + time.sleep(3) + + if __name__ == "__main__": setup() test_basic_api()