HandsON-BuildHat-API 1.0.6__tar.gz → 1.0.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {handson_buildhat_api-1.0.6/src/HandsON_BuildHat_API.egg-info → handson_buildhat_api-1.0.7}/PKG-INFO +2 -2
- {handson_buildhat_api-1.0.6 → handson_buildhat_api-1.0.7}/README.md +1 -1
- {handson_buildhat_api-1.0.6 → handson_buildhat_api-1.0.7}/pyproject.toml +1 -1
- {handson_buildhat_api-1.0.6 → handson_buildhat_api-1.0.7}/src/HandsON_BuildHat_API/SpikePI.py +13 -12
- {handson_buildhat_api-1.0.6 → handson_buildhat_api-1.0.7/src/HandsON_BuildHat_API.egg-info}/PKG-INFO +2 -2
- {handson_buildhat_api-1.0.6 → handson_buildhat_api-1.0.7}/LICENSE +0 -0
- {handson_buildhat_api-1.0.6 → handson_buildhat_api-1.0.7}/setup.cfg +0 -0
- {handson_buildhat_api-1.0.6 → handson_buildhat_api-1.0.7}/src/HandsON_BuildHat_API/__init__.py +0 -0
- {handson_buildhat_api-1.0.6 → handson_buildhat_api-1.0.7}/src/HandsON_BuildHat_API.egg-info/SOURCES.txt +0 -0
- {handson_buildhat_api-1.0.6 → handson_buildhat_api-1.0.7}/src/HandsON_BuildHat_API.egg-info/dependency_links.txt +0 -0
- {handson_buildhat_api-1.0.6 → handson_buildhat_api-1.0.7}/src/HandsON_BuildHat_API.egg-info/requires.txt +0 -0
- {handson_buildhat_api-1.0.6 → handson_buildhat_api-1.0.7}/src/HandsON_BuildHat_API.egg-info/top_level.txt +0 -0
{handson_buildhat_api-1.0.6/src/HandsON_BuildHat_API.egg-info → handson_buildhat_api-1.0.7}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: HandsON-BuildHat-API
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.7
|
|
4
4
|
Summary: A third-party API for controlling LEGO SPIKE devices
|
|
5
5
|
Author-email: HaNeul Jung <hnjung@handsontech.co.kr>
|
|
6
6
|
License: Proprietary - Personal/Educational Use Only
|
|
@@ -17,7 +17,7 @@ HandsON Build Hat API
|
|
|
17
17
|
=======
|
|
18
18
|
**Production** : HandsON Technology co., ltd.
|
|
19
19
|
**Author** : HaNeul Jung (hnjung@handsontech.co.kr)
|
|
20
|
-
**Last Update** : 2025-
|
|
20
|
+
**Last Update** : 2025-09-01
|
|
21
21
|
|
|
22
22
|
## 주의
|
|
23
23
|
2025-08-27 이전 판매된 빌드햇 제품의 경우 1.0.4 버전을 사용
|
{handson_buildhat_api-1.0.6 → handson_buildhat_api-1.0.7}/src/HandsON_BuildHat_API/SpikePI.py
RENAMED
|
@@ -9,8 +9,8 @@ from serial import Serial
|
|
|
9
9
|
import time
|
|
10
10
|
|
|
11
11
|
class _ConstButtonID:
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
START = 0
|
|
13
|
+
STOP = 1
|
|
14
14
|
|
|
15
15
|
LEFT = 2
|
|
16
16
|
RIGHT = 3
|
|
@@ -93,7 +93,7 @@ class _SerialManager:
|
|
|
93
93
|
serial = None
|
|
94
94
|
|
|
95
95
|
for i in _serial_port:
|
|
96
|
-
try: serial = Serial(port=i, baudrate=115200, timeout=0.
|
|
96
|
+
try: serial = Serial(port=i, baudrate=115200, timeout=0.02)
|
|
97
97
|
except: pass
|
|
98
98
|
else: break
|
|
99
99
|
|
|
@@ -128,6 +128,7 @@ class _ModuleParent:
|
|
|
128
128
|
if data == b'': continue
|
|
129
129
|
|
|
130
130
|
if _Availability.checksum_check(data): return data
|
|
131
|
+
if ((len(data) == 1) and (data[0] == 0x04)): return data
|
|
131
132
|
|
|
132
133
|
def _send_data(self, byte:bytes) -> None:
|
|
133
134
|
com = byte
|
|
@@ -209,7 +210,7 @@ class Motor(_ModuleParent):
|
|
|
209
210
|
|
|
210
211
|
def stop(self) -> None:
|
|
211
212
|
com = bytes((_ConstValue.TRA_DATA + self._PORT, _ConstValue.MOTOR_STOP, 0, 0))
|
|
212
|
-
self.
|
|
213
|
+
self._get_data(com)
|
|
213
214
|
|
|
214
215
|
def start(self, speed:int) -> None:
|
|
215
216
|
if not speed in range(-100, 101):
|
|
@@ -219,7 +220,7 @@ class Motor(_ModuleParent):
|
|
|
219
220
|
else: sw = 0
|
|
220
221
|
|
|
221
222
|
com = bytes((_ConstValue.TRA_DATA + self._PORT, _ConstValue.MOTOR_PWM, abs(speed), sw))
|
|
222
|
-
self.
|
|
223
|
+
self._get_data(com)
|
|
223
224
|
|
|
224
225
|
def run_to_position(self, degrees, speed) -> None:
|
|
225
226
|
if not speed in range(0, 101):
|
|
@@ -231,7 +232,7 @@ class Motor(_ModuleParent):
|
|
|
231
232
|
else: target = degrees & 0xFFFF
|
|
232
233
|
|
|
233
234
|
com = bytes((_ConstValue.TRA_DATA + self._PORT, _ConstValue.MOTOR_ABS, speed, (target & 0xFF), (target >> 8)))
|
|
234
|
-
self.
|
|
235
|
+
self._get_data(com)
|
|
235
236
|
|
|
236
237
|
def run_for_degrees(self, degrees, speed) -> None:
|
|
237
238
|
if not speed in range(0, 101):
|
|
@@ -244,7 +245,7 @@ class Motor(_ModuleParent):
|
|
|
244
245
|
else: target = degrees & 0xFFFFFFFF
|
|
245
246
|
|
|
246
247
|
com = bytes((_ConstValue.TRA_DATA + self._PORT, _ConstValue.MOTOR_REL, speed, (target & 0xFF), (target >> 8) & 0xFF, (target >> 16) & 0xFF, (target >> 24) & 0xFF))
|
|
247
|
-
self.
|
|
248
|
+
self._get_data(com)
|
|
248
249
|
|
|
249
250
|
def get_speed(self) -> int:
|
|
250
251
|
command = [_ConstValue.GET_DATA + self._PORT]
|
|
@@ -272,7 +273,7 @@ class MotorPair(_ModuleParent):
|
|
|
272
273
|
def stop(self) -> None:
|
|
273
274
|
for i in self._PORTs:
|
|
274
275
|
com = bytes((_ConstValue.TRA_DATA + i, _ConstValue.MOTOR_PWM, 0, 0))
|
|
275
|
-
self.
|
|
276
|
+
self._get_data(com)
|
|
276
277
|
|
|
277
278
|
def start(self, steering, speed) -> None:
|
|
278
279
|
if not steering in range(-100, 101):
|
|
@@ -290,7 +291,7 @@ class MotorPair(_ModuleParent):
|
|
|
290
291
|
else: sw = 0
|
|
291
292
|
|
|
292
293
|
com = bytes((_ConstValue.TRA_DATA + motor, _ConstValue.MOTOR_PWM, abs(speed), sw))
|
|
293
|
-
self.
|
|
294
|
+
self._get_data(com)
|
|
294
295
|
|
|
295
296
|
def move(self, degrees, steering, speed) -> None:
|
|
296
297
|
if not steering in range(-100, 101):
|
|
@@ -313,7 +314,7 @@ class MotorPair(_ModuleParent):
|
|
|
313
314
|
if count == 1: target = ~target
|
|
314
315
|
|
|
315
316
|
com = bytes((_ConstValue.TRA_DATA + motor, _ConstValue.MOTOR_REL, speed, (target & 0xFF), (target >> 8) & 0xFF, (target >> 16) & 0xFF, (target >> 24) & 0xFF))
|
|
316
|
-
self.
|
|
317
|
+
self._get_data(com)
|
|
317
318
|
|
|
318
319
|
|
|
319
320
|
def move_tank(self, degrees, left_speed, right_speed) -> None:
|
|
@@ -335,7 +336,7 @@ class MotorPair(_ModuleParent):
|
|
|
335
336
|
if count == 1: target = ~target
|
|
336
337
|
|
|
337
338
|
com = bytes((_ConstValue.TRA_DATA + motor, _ConstValue.MOTOR_REL, speed, (target & 0xFF), (target >> 8) & 0xFF, (target >> 16) & 0xFF, (target >> 24) & 0xFF))
|
|
338
|
-
self.
|
|
339
|
+
self._get_data(com)
|
|
339
340
|
|
|
340
341
|
def start_tank(self, left_speed, right_speed) -> None:
|
|
341
342
|
if not left_speed in range(-100, 101) or not right_speed in range(-100, 101):
|
|
@@ -351,4 +352,4 @@ class MotorPair(_ModuleParent):
|
|
|
351
352
|
else: sw = 0
|
|
352
353
|
|
|
353
354
|
com = bytes((_ConstValue.TRA_DATA + motor, _ConstValue.MOTOR_PWM, abs(speed), sw))
|
|
354
|
-
self.
|
|
355
|
+
self._get_data(com)
|
{handson_buildhat_api-1.0.6 → handson_buildhat_api-1.0.7/src/HandsON_BuildHat_API.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: HandsON-BuildHat-API
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.7
|
|
4
4
|
Summary: A third-party API for controlling LEGO SPIKE devices
|
|
5
5
|
Author-email: HaNeul Jung <hnjung@handsontech.co.kr>
|
|
6
6
|
License: Proprietary - Personal/Educational Use Only
|
|
@@ -17,7 +17,7 @@ HandsON Build Hat API
|
|
|
17
17
|
=======
|
|
18
18
|
**Production** : HandsON Technology co., ltd.
|
|
19
19
|
**Author** : HaNeul Jung (hnjung@handsontech.co.kr)
|
|
20
|
-
**Last Update** : 2025-
|
|
20
|
+
**Last Update** : 2025-09-01
|
|
21
21
|
|
|
22
22
|
## 주의
|
|
23
23
|
2025-08-27 이전 판매된 빌드햇 제품의 경우 1.0.4 버전을 사용
|
|
File without changes
|
|
File without changes
|
{handson_buildhat_api-1.0.6 → handson_buildhat_api-1.0.7}/src/HandsON_BuildHat_API/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|