smartpi 0.1.6__py3-none-any.whl → 0.1.8__py3-none-any.whl

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.
smartpi/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  __all__ = ["base_driver"]
2
2
 
3
- __version__ = "0.1.6"
3
+ __version__ = "0.1.8"
4
4
 
smartpi/base_driver.py CHANGED
@@ -2,7 +2,7 @@
2
2
  import serial,time,struct
3
3
  from typing import List, Optional
4
4
  from collections import deque
5
- from . import motor,cw2015,gui
5
+ from . import servo,motor,cw2015,gui
6
6
 
7
7
 
8
8
  # 命令常量
@@ -506,6 +506,18 @@ def smartpi_init():
506
506
  P_port_init(4)
507
507
  P_port_init(5)
508
508
  P_port_init(6)
509
+ servo.set_init(1)
510
+ servo.set_init(2)
511
+ servo.set_init(3)
512
+ servo.set_init(4)
513
+ servo.set_init(5)
514
+ servo.set_init(6)
515
+ motor.set_motor(1,0)
516
+ motor.set_motor(2,0)
517
+ motor.set_motor(3,0)
518
+ motor.set_motor(4,0)
519
+ motor.set_motor(5,0)
520
+ motor.set_motor(6,0)
509
521
  servo.reset_encode(1)
510
522
  servo.reset_encode(2)
511
523
  servo.reset_encode(3)
@@ -518,12 +530,7 @@ def smartpi_init():
518
530
  motor.reset_motor_encoder(4)
519
531
  motor.reset_motor_encoder(5)
520
532
  motor.reset_motor_encoder(6)
521
- motor.set_motor(1,0)
522
- motor.set_motor(2,0)
523
- motor.set_motor(3,0)
524
- motor.set_motor(4,0)
525
- motor.set_motor(5,0)
526
- motor.set_motor(6,0)
533
+ time.sleep(0.1)
527
534
  gui.init()
528
-
535
+ time.sleep(0.1)
529
536
 
smartpi/motor.py CHANGED
@@ -68,7 +68,7 @@ def set_motor_stop(port:bytes) -> Optional[bytes]:
68
68
  else:
69
69
  return -1
70
70
 
71
- #���������� port:����M�˿ڣ�speed:-100~100��code:0~65535
71
+ #����Ƕȿ��� port:����M�˿ڣ�speed:-100~100��degree:0~65535
72
72
  def set_motor_angle(port:bytes,speed:int,degree:int) -> Optional[bytes]:
73
73
  motor_str=[0xA0, 0x01, 0x04, 0x81, 0x00, 0x81, 0x00, 0x00, 0xBE]
74
74
  motor_str[0]=0XA0+port
smartpi/servo.py CHANGED
@@ -28,7 +28,7 @@ def steer_angle_delay(port:bytes,angle:bytes,second:bytes) -> Optional[bytes]:
28
28
  else:
29
29
  return -1
30
30
 
31
- #BE-9528������ٶ�ת���Ƕ� port:����P�˿ڣ�angle:�Ƕ�(0~360)��speed:�ٶ�(0~100)��
31
+ #BE-9528���ֶ�����ٶ�ת���Ƕ� port:����P�˿ڣ�angle:�Ƕ�(0~360)��speed:�ٶ�(0~100)��
32
32
  def set_angle_speed(port:bytes,angle:bytes,speed:bytes) -> Optional[bytes]:
33
33
  servo_str=[0xA0, 0x0D, 0x01, 0x81, 0x00, 0x00, 0x81, 0x00, 0xBE]
34
34
  servo_str[0]=0XA0+port
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: smartpi
3
- Version: 0.1.6
3
+ Version: 0.1.8
4
4
  Summary: A library use for H2-RCU
5
5
  Author: ZMROBO
6
6
  Classifier: Programming Language :: Python :: 3
@@ -1,18 +1,18 @@
1
- smartpi/__init__.py,sha256=0B0ifjRnjFk7ubY8GaCY6TAxKq72V5fx3gH_rqOu5yE,54
2
- smartpi/base_driver.py,sha256=wYfho3veNKaL0mr_9UnEo2MSmsaKIAZY83UkiDWTWCw,17810
1
+ smartpi/__init__.py,sha256=ntmh9G-IsdXNEPRe_52sLjRLb1hsWYsxo6nUiioBpJ4,54
2
+ smartpi/base_driver.py,sha256=bFd1rZfjgVCq4UYPNNJQKbQunyLtv_IyEYhiZgHtB_Y,17988
3
3
  smartpi/color_sensor.py,sha256=IubJb8zd87oWf3qTn07wTHM2vjUADwgSdXUChGgovHw,492
4
4
  smartpi/cw2015.py,sha256=1lAF-pi_ye_ya1AZQS1sjbgsDf7MThO5IAskKsNGBzA,5695
5
5
  smartpi/gui.py,sha256=E98_soyWbEf_dwYhXZgMSXrgY5QuYoDTuFCPK63flIQ,2102
6
6
  smartpi/humidity.py,sha256=-awlSiy7ea6iwtirUMdDAMmmdIgVQZ3D7cDzgXmy314,493
7
7
  smartpi/led.py,sha256=92SBKjQbg1HN6rtKRH1NNWvAFRBP2-5OUGM9muOvhyQ,526
8
8
  smartpi/light_sensor.py,sha256=wsW0_ZnKeHN6IWRH3CIybKLdHPVK2I8jSTCqXlUECVk,565
9
- smartpi/motor.py,sha256=ePBKQu7FSrqjnM-d1kDcT1nYMLpnLeALJ0agI2dznoQ,4447
9
+ smartpi/motor.py,sha256=vdtLjHSwCodFkqhYh0y3l8RSl7IUlMwdNuktgQ3FdkQ,4449
10
10
  smartpi/move.py,sha256=1LpNlveTJLnObyD4nzbHIC0rlkPuPUwPtnF3sgr1t6g,6599
11
- smartpi/servo.py,sha256=3cGyBattPY0nXQvJl3b462VGyyzca7S33X_9xIp2tUQ,4533
11
+ smartpi/servo.py,sha256=_eM3ZAcBA543iVyFi8agOAXt0K3LEauxwyq7SFCpygM,4537
12
12
  smartpi/temperature.py,sha256=JeuiwsV6AUjnFQsQxgvjM3AuBrVvK5DuSE-BbX1Di2s,456
13
13
  smartpi/touch_sensor.py,sha256=jlKqvcoSmfZzH9zJeafBeVEQhxIYkkzXe4_fifX0COI,434
14
14
  smartpi/ultrasonic.py,sha256=5MS0EdQNirAl8iZbdwZ63fnjp6axHRZHw6dJwcwuXnQ,618
15
- smartpi-0.1.6.dist-info/METADATA,sha256=7Vgj7YD3AWgt5LM-IUQxXqvT__TVMf-6scr1I7K8fWw,310
16
- smartpi-0.1.6.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
17
- smartpi-0.1.6.dist-info/top_level.txt,sha256=PoLhUCmWAiQUg5UeN2fS-Y1iQyBbF2rdUlizXtpHGRQ,8
18
- smartpi-0.1.6.dist-info/RECORD,,
15
+ smartpi-0.1.8.dist-info/METADATA,sha256=Gi4SGmhnZmZnC9ROapd9jCoohhoEKJtv6epGUke4LqE,310
16
+ smartpi-0.1.8.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
17
+ smartpi-0.1.8.dist-info/top_level.txt,sha256=PoLhUCmWAiQUg5UeN2fS-Y1iQyBbF2rdUlizXtpHGRQ,8
18
+ smartpi-0.1.8.dist-info/RECORD,,