Skip to content

Commit 4433574

Browse files
committed
update test
1 parent 7da4b1a commit 4433574

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed

pymycobot/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ We support Python2, Python3.5 or later.
6363
* [set_gripper_value](#set_gripper_value)
6464
* [set_gripper_ini](#set_gripper_ini)
6565
* [is_gripper_moving](#is_gripper_moving)
66+
* [Basic](#basic)
67+
* [set_basic_output](#set_basic_output)
6668
* [Angle](#angle)
6769
* [Coord](#coord)
6870

@@ -605,6 +607,19 @@ from pymycobot.mycobot import MyCobot
605607
- `1` : is moving
606608
- `-1`: error data
607609

610+
## Basic
611+
612+
### set_basic_output
613+
614+
- **Prototype**: `set_basic_output(pin_no, pin_signal)`
615+
616+
- **Description**: Set bottom pin.
617+
618+
- **Parameters**
619+
620+
- `pin_no` (`int`) Pin number.
621+
- `pin_signal` (`int`): 0 / 1
622+
608623
# Angle
609624

610625
```python

tests/test_api.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ def test_jog(setup):
103103
mc.pause()
104104

105105
time.sleep(3)
106-
print(mc.is_paused()) # FIXME:
106+
print(mc.is_paused()) # FIXME:
107107
print("speed get", mc.get_speed())
108108
mc.set_speed(20)
109109
print("speed set", mc.get_speed())
110110
assert mc.get_speed() == 20
111111
time.sleep(6)
112112

113113
print("resume")
114-
mc.resume() # FIXME:
114+
mc.resume() # FIXME:
115115
time.sleep(10)
116116

117117
coords = [160, 140, 160, 0, 0, 0]
@@ -136,7 +136,7 @@ def test_state_control(setup):
136136
time.sleep(4)
137137

138138
print("is moving: 1 - true, 0 - false")
139-
print(mc.is_moving()) # FIXME:
139+
print(mc.is_moving()) # FIXME:
140140
time.sleep(1)
141141
mc.jog_angle(1, 1, 10)
142142
time.sleep(1)
@@ -247,6 +247,26 @@ def test_io(setup):
247247
mc.set_digital_output(19, 0)
248248

249249

250+
def test_pump(setup):
251+
print("==========================================================")
252+
print("Start Pump test...")
253+
254+
def pump_on():
255+
mc.set_basic_output(2, 0)
256+
mc.set_basic_output(5, 0)
257+
258+
def pump_off():
259+
mc.set_basic_output(2, 1)
260+
mc.set_basic_output(5, 1)
261+
262+
pump_off()
263+
time.sleep(3)
264+
pump_on()
265+
time.sleep(3)
266+
pump_off()
267+
time.sleep(3)
268+
269+
250270
if __name__ == "__main__":
251271
setup()
252272
test_basic_api()

0 commit comments

Comments
 (0)