1
0
mirror of https://github.com/undera/pylgbst.git synced 2020-11-18 19:37:26 -08:00

Harmonograph demo

This commit is contained in:
Andrey Pohilko 2018-07-16 10:32:35 +03:00
parent 77752460e9
commit 8f1e3cb989

View File

@ -0,0 +1,26 @@
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()