mirror of
https://github.com/undera/pylgbst.git
synced 2020-11-18 19:37:26 -08:00
27 lines
664 B
Python
27 lines
664 B
Python
import logging
|
|
import traceback
|
|
|
|
import time
|
|
|
|
from pylgbst import MoveHub
|
|
from pylgbst.comms import DebugServerConnection, BLEConnection
|
|
|
|
if __name__ == '__main__':
|
|
logging.basicConfig(level=logging.INFO)
|
|
|
|
try:
|
|
conn = DebugServerConnection()
|
|
except BaseException:
|
|
logging.warning("Failed to use debug server: %s", traceback.format_exc())
|
|
conn = BLEConnection().connect()
|
|
|
|
hub = MoveHub(conn)
|
|
try:
|
|
hub.motor_AB.constant(0.45, 0.45)
|
|
hub.motor_external.angled(12590, 0.1)
|
|
#time.sleep(180)
|
|
finally:
|
|
hub.motor_AB.stop()
|
|
if hub.motor_external:
|
|
hub.motor_external.stop()
|