mirror of
https://github.com/undera/pylgbst.git
synced 2020-11-18 19:37:26 -08:00
Harmonograph demo
This commit is contained in:
parent
77752460e9
commit
8f1e3cb989
26
examples/harmonograph/__init__.py
Normal file
26
examples/harmonograph/__init__.py
Normal 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()
|
Loading…
x
Reference in New Issue
Block a user