HandsON-BuildHat-API 1.0.4__tar.gz → 1.0.6__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.
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: HandsON-BuildHat-API
3
- Version: 1.0.4
3
+ Version: 1.0.6
4
4
  Summary: A third-party API for controlling LEGO SPIKE devices
5
- Author-email: HandsON Technology <caffeine.reload@gmail.com>
5
+ Author-email: HaNeul Jung <hnjung@handsontech.co.kr>
6
6
  License: Proprietary - Personal/Educational Use Only
7
7
  Classifier: Programming Language :: Python :: 3
8
8
  Classifier: License :: Other/Proprietary License
@@ -16,8 +16,12 @@ Dynamic: license-file
16
16
  HandsON Build Hat API
17
17
  =======
18
18
  **Production** : HandsON Technology co., ltd.
19
- **Author** : HaNeul Jung (caffeine.reload@gmail.com)
20
- **Last Update** : 2025-06-07
19
+ **Author** : HaNeul Jung (hnjung@handsontech.co.kr)
20
+ **Last Update** : 2025-08-29
21
+
22
+ ## 주의
23
+ 2025-08-27 이전 판매된 빌드햇 제품의 경우 1.0.4 버전을 사용
24
+ 이후 판매된 모든 빌드햇은 1.0.5 이상의 버전을 사용하십시오.
21
25
 
22
26
  ## 개요
23
27
  제작된 빌드햇의 제어에 필요한 API 라이브러리
@@ -1,8 +1,12 @@
1
1
  HandsON Build Hat API
2
2
  =======
3
3
  **Production** : HandsON Technology co., ltd.
4
- **Author** : HaNeul Jung (caffeine.reload@gmail.com)
5
- **Last Update** : 2025-06-07
4
+ **Author** : HaNeul Jung (hnjung@handsontech.co.kr)
5
+ **Last Update** : 2025-08-29
6
+
7
+ ## 주의
8
+ 2025-08-27 이전 판매된 빌드햇 제품의 경우 1.0.4 버전을 사용
9
+ 이후 판매된 모든 빌드햇은 1.0.5 이상의 버전을 사용하십시오.
6
10
 
7
11
  ## 개요
8
12
  제작된 빌드햇의 제어에 필요한 API 라이브러리
@@ -1,10 +1,10 @@
1
1
 
2
2
  [project]
3
3
  name = "HandsON-BuildHat-API"
4
- version = "1.0.4"
4
+ version = "1.0.6"
5
5
  description = "A third-party API for controlling LEGO SPIKE devices"
6
6
  authors = [
7
- { name="HandsON Technology", email="caffeine.reload@gmail.com" }
7
+ { name="HaNeul Jung", email="hnjung@handsontech.co.kr" }
8
8
  ]
9
9
  license = {text = "Proprietary - Personal/Educational Use Only"}
10
10
  readme = "README.md"
@@ -37,9 +37,11 @@ class _ConstValue:
37
37
 
38
38
  ALL_PORT = 0b1111
39
39
 
40
- MOTOR_PWM_MODE = 0
41
- MOTOR_ABS_MODE = 1
42
- MOTOR_REL_MODE = 2
40
+ MOTOR_STOP = 0
41
+ MOTOR_PWM = 1
42
+ MOTOR_ABS = 2
43
+ MOTOR_REL = 3
44
+ MOTOR_BRAKE = 255
43
45
 
44
46
  class _PORT:
45
47
  PORT = {
@@ -206,7 +208,7 @@ class Motor(_ModuleParent):
206
208
  self._module_check(self._PORT, (_ConstModuleID.SMALL_MOTOR, _ConstModuleID.MEDIUM_MOTOR, _ConstModuleID.LARGE_MOTOR))
207
209
 
208
210
  def stop(self) -> None:
209
- com = bytes((_ConstValue.TRA_DATA + self._PORT, _ConstValue.MOTOR_PWM_MODE, 0, 0))
211
+ com = bytes((_ConstValue.TRA_DATA + self._PORT, _ConstValue.MOTOR_STOP, 0, 0))
210
212
  self._send_data(com)
211
213
 
212
214
  def start(self, speed:int) -> None:
@@ -216,7 +218,7 @@ class Motor(_ModuleParent):
216
218
  if speed > 0: sw = 1
217
219
  else: sw = 0
218
220
 
219
- com = bytes((_ConstValue.TRA_DATA + self._PORT, _ConstValue.MOTOR_PWM_MODE, sw, abs(speed)))
221
+ com = bytes((_ConstValue.TRA_DATA + self._PORT, _ConstValue.MOTOR_PWM, abs(speed), sw))
220
222
  self._send_data(com)
221
223
 
222
224
  def run_to_position(self, degrees, speed) -> None:
@@ -228,7 +230,7 @@ class Motor(_ModuleParent):
228
230
  if degrees >= 0: target = degrees
229
231
  else: target = degrees & 0xFFFF
230
232
 
231
- com = bytes((_ConstValue.TRA_DATA + self._PORT, _ConstValue.MOTOR_ABS_MODE, speed, (target & 0xFF), (target >> 8)))
233
+ com = bytes((_ConstValue.TRA_DATA + self._PORT, _ConstValue.MOTOR_ABS, speed, (target & 0xFF), (target >> 8)))
232
234
  self._send_data(com)
233
235
 
234
236
  def run_for_degrees(self, degrees, speed) -> None:
@@ -241,7 +243,7 @@ class Motor(_ModuleParent):
241
243
  if degrees >= 0: target = degrees
242
244
  else: target = degrees & 0xFFFFFFFF
243
245
 
244
- com = bytes((_ConstValue.TRA_DATA + self._PORT, _ConstValue.MOTOR_REL_MODE, speed, (target & 0xFF), (target >> 8) & 0xFF, (target >> 16) & 0xFF, (target >> 24) & 0xFF))
246
+ com = bytes((_ConstValue.TRA_DATA + self._PORT, _ConstValue.MOTOR_REL, speed, (target & 0xFF), (target >> 8) & 0xFF, (target >> 16) & 0xFF, (target >> 24) & 0xFF))
245
247
  self._send_data(com)
246
248
 
247
249
  def get_speed(self) -> int:
@@ -269,7 +271,7 @@ class MotorPair(_ModuleParent):
269
271
 
270
272
  def stop(self) -> None:
271
273
  for i in self._PORTs:
272
- com = bytes((_ConstValue.TRA_DATA + i, _ConstValue.MOTOR_PWM_MODE, 0, 0))
274
+ com = bytes((_ConstValue.TRA_DATA + i, _ConstValue.MOTOR_PWM, 0, 0))
273
275
  self._send_data(com)
274
276
 
275
277
  def start(self, steering, speed) -> None:
@@ -287,7 +289,7 @@ class MotorPair(_ModuleParent):
287
289
  if speed > 0: sw = 1
288
290
  else: sw = 0
289
291
 
290
- com = bytes((_ConstValue.TRA_DATA + motor, _ConstValue.MOTOR_PWM_MODE, sw, abs(speed)))
292
+ com = bytes((_ConstValue.TRA_DATA + motor, _ConstValue.MOTOR_PWM, abs(speed), sw))
291
293
  self._send_data(com)
292
294
 
293
295
  def move(self, degrees, steering, speed) -> None:
@@ -310,7 +312,7 @@ class MotorPair(_ModuleParent):
310
312
 
311
313
  if count == 1: target = ~target
312
314
 
313
- com = bytes((_ConstValue.TRA_DATA + motor, _ConstValue.MOTOR_REL_MODE, speed, (target & 0xFF), (target >> 8) & 0xFF, (target >> 16) & 0xFF, (target >> 24) & 0xFF))
315
+ com = bytes((_ConstValue.TRA_DATA + motor, _ConstValue.MOTOR_REL, speed, (target & 0xFF), (target >> 8) & 0xFF, (target >> 16) & 0xFF, (target >> 24) & 0xFF))
314
316
  self._send_data(com)
315
317
 
316
318
 
@@ -332,7 +334,7 @@ class MotorPair(_ModuleParent):
332
334
 
333
335
  if count == 1: target = ~target
334
336
 
335
- com = bytes((_ConstValue.TRA_DATA + motor, _ConstValue.MOTOR_REL_MODE, speed, (target & 0xFF), (target >> 8) & 0xFF, (target >> 16) & 0xFF, (target >> 24) & 0xFF))
337
+ com = bytes((_ConstValue.TRA_DATA + motor, _ConstValue.MOTOR_REL, speed, (target & 0xFF), (target >> 8) & 0xFF, (target >> 16) & 0xFF, (target >> 24) & 0xFF))
336
338
  self._send_data(com)
337
339
 
338
340
  def start_tank(self, left_speed, right_speed) -> None:
@@ -348,5 +350,5 @@ class MotorPair(_ModuleParent):
348
350
  if speed > 0: sw = 1
349
351
  else: sw = 0
350
352
 
351
- com = bytes((_ConstValue.TRA_DATA + motor, _ConstValue.MOTOR_PWM_MODE, sw, abs(speed)))
353
+ com = bytes((_ConstValue.TRA_DATA + motor, _ConstValue.MOTOR_PWM, abs(speed), sw))
352
354
  self._send_data(com)
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: HandsON-BuildHat-API
3
- Version: 1.0.4
3
+ Version: 1.0.6
4
4
  Summary: A third-party API for controlling LEGO SPIKE devices
5
- Author-email: HandsON Technology <caffeine.reload@gmail.com>
5
+ Author-email: HaNeul Jung <hnjung@handsontech.co.kr>
6
6
  License: Proprietary - Personal/Educational Use Only
7
7
  Classifier: Programming Language :: Python :: 3
8
8
  Classifier: License :: Other/Proprietary License
@@ -16,8 +16,12 @@ Dynamic: license-file
16
16
  HandsON Build Hat API
17
17
  =======
18
18
  **Production** : HandsON Technology co., ltd.
19
- **Author** : HaNeul Jung (caffeine.reload@gmail.com)
20
- **Last Update** : 2025-06-07
19
+ **Author** : HaNeul Jung (hnjung@handsontech.co.kr)
20
+ **Last Update** : 2025-08-29
21
+
22
+ ## 주의
23
+ 2025-08-27 이전 판매된 빌드햇 제품의 경우 1.0.4 버전을 사용
24
+ 이후 판매된 모든 빌드햇은 1.0.5 이상의 버전을 사용하십시오.
21
25
 
22
26
  ## 개요
23
27
  제작된 빌드햇의 제어에 필요한 API 라이브러리