Skip to content

Commit 3af3492

Browse files
committed
Add multi-robots testcase
1 parent f2ec853 commit 3af3492

File tree

5 files changed

+20
-4
lines changed

5 files changed

+20
-4
lines changed

neopia/neosoco.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def __init__(self, index=0, port_name=None):
308308
self._init(port_name)
309309

310310
def dispose(self):
311-
# Lastly send init packe to stop all action in the controller
311+
# Lastly send init packet to stop all action in the controller
312312
self.write(Neosoco.OUTPUT_1, 0)
313313
self.write(Neosoco.OUTPUT_2, 0)
314314
self.write(Neosoco.OUTPUT_3, 0)

neopia/neosoco_neobot.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,21 @@ def _encode_motoring_packet(self, address):
204204
result += self._to_hex(self._make_checksum(result)) # Checksum
205205
return result
206206

207+
def _encode_init_packet(self):
208+
result = ""
209+
with self._thread_lock:
210+
result += START_BYTES
211+
result += self._to_hex(0) # OUT1
212+
result += self._to_hex(0) # OUT2
213+
result += self._to_hex(0) # OUT3
214+
result += self._to_hex(0) # MLA
215+
result += self._to_hex(0) # MRA
216+
result += self._to_hex(0) # BUZZER
217+
result += self._to_hex(0) # FND
218+
result += self._to_hex(0) # Not Used
219+
result += self._to_hex(self._make_checksum(result)) # Checksum
220+
return result
221+
207222
def _decode_sensory_packet(self, packet):
208223
# packet[0]~[1] is StartBytes
209224
self._input_1_device._put(packet[2])

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name="neopia",
5-
version="0.1.5",
5+
version="0.1.6",
66
author="RoboticsWare",
77
author_email="[email protected]",
88
description="Python library for Neopia neobot",

multi-robots_test.py renamed to test/multi-robots_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def led_blink(soco):
2525

2626
def wag_tail(soco):
2727
soco.servo_rotate_by_degree('out1', 'forward', '100', '60')
28+
soco.servo_rotate_by_degree('out1', 'backward', '100', '0')
2829
soco.servo_rotate_by_degree('out1', 'backward', '100', '60')
2930
soco.servo_rotate_by_degree('out1', 'forward', '100', '0')
3031

test.py renamed to test/test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,5 @@
121121
# n.led_off('out1')
122122

123123
# case 15) Turn on color LED with red color during 3s
124-
n.color_led_on('out1', 255, 0, 0)
125-
wait(3000)
124+
# n.color_led_on('out1', 255, 0, 0)
125+
# wait(3000)

0 commit comments

Comments
 (0)