Skip to content

Commit f10315f

Browse files
Zachary ZhangZachary Zhang
authored andcommitted
modify setup.py
1 parent 9871621 commit f10315f

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

API/Python/pymycobot/mycobot.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ def send_angle(self, id, degree, speed):
9898
9999
'''
100100
_hex = self._angle_to_hex(degree)
101-
command = 'fefe0621{}{}{}fa'.format(id, _hex, hex(speed)[2:])
101+
speed = self._complement_zero(hex(speed)[2:], digit=2)
102+
command = 'fefe0621{}{}{}fa'.format(id, _hex, speed)
102103
# print(command)
103104
self._write(command)
104105

@@ -267,7 +268,7 @@ def is_moving(self):
267268

268269
def pause(self):
269270
self._write('fefe0226fa')
270-
271+
271272
def resume(self):
272273
self._write('fefe0228fa')
273274

@@ -279,7 +280,7 @@ def is_paused(self):
279280
data = self._read()
280281
flag = int(data.hex(), 16)
281282
return False if flag else True
282-
283+
283284
def is_in_position(self, coords):
284285
if len(coords) != 6:
285286
print('The lenght of coords is not right')
@@ -376,7 +377,7 @@ def _coord_to_hex(self, coord):
376377
s = str(hex(int(coord)))[2:]
377378
s = self._complement_zero(s)
378379
return s
379-
380+
380381
def _complement_zero(self, s, digit=4):
381382
s_len = len(s)
382383
if s_len == digit:
@@ -394,3 +395,4 @@ def _write(self, data):
394395
def _read(self, size=1024):
395396
data = self.serial_port.read(size)
396397
return data
398+

API/Python/setup.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import sys
22

3-
if (3, 5) != sys.version_info[:2] < (3, 5):
4-
print("This mycobot version requires Python 3.5 or later.")
3+
if (2, 7) != sys.version_info[:2] < (3, 5):
4+
print("This mycobot version requires Python2.7, 3.5 or later.")
55
sys.exit(1)
66

77
import setuptools
88

9-
with open("README.md", "r", encoding="utf-8") as fh:
10-
long_description = fh.read()
9+
long_description = '''
10+
11+
'''
1112

1213
setuptools.setup(
1314
name="pymycobot",
@@ -28,3 +29,4 @@
2829
python_requires='2.7, >=3.5',
2930
)
3031

32+

0 commit comments

Comments
 (0)