mirror of
https://github.com/undera/pylgbst.git
synced 2020-11-18 19:37:26 -08:00
Cosmetics
This commit is contained in:
parent
b0bdbebf56
commit
e215828ab3
@ -8,9 +8,10 @@ Best way to start is to look into [`demo.py`](examples/demo.py) file, and run it
|
|||||||
|
|
||||||
If you have Vernie assembled, you might run scripts from [`vernie`](examples/vernie/) directory.
|
If you have Vernie assembled, you might run scripts from [`vernie`](examples/vernie/) directory.
|
||||||
|
|
||||||
Demonstrational video:
|
Demonstrational videos:
|
||||||
|
|
||||||
[](http://www.youtube.com/watch?v=oqsmgZlVE8I)
|
[](http://www.youtube.com/watch?v=oqsmgZlVE8I)
|
||||||
|
[](https://youtu.be/ZbKmqVBBMhM)
|
||||||
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
@ -58,7 +58,7 @@ class Plotter(object):
|
|||||||
self._hub.color_distance_sensor.unsubscribe(self._on_distance)
|
self._hub.color_distance_sensor.unsubscribe(self._on_distance)
|
||||||
|
|
||||||
if self._marker_color == COLOR_CYAN:
|
if self._marker_color == COLOR_CYAN:
|
||||||
self.move(- 0.1, 0)
|
self.move(-0.1, 0)
|
||||||
else:
|
else:
|
||||||
self.move(-1.0, 0)
|
self.move(-1.0, 0)
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ import time
|
|||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
from examples.plotter import Plotter
|
from examples.plotter import Plotter
|
||||||
|
from examples.plotter.lego import lego
|
||||||
from pylgbst import EncodedMotor, PORT_AB, PORT_C, PORT_A, PORT_B, MoveHub
|
from pylgbst import EncodedMotor, PORT_AB, PORT_C, PORT_A, PORT_B, MoveHub
|
||||||
from pylgbst.comms import DebugServerConnection, BLEConnection
|
from pylgbst.comms import DebugServerConnection, BLEConnection
|
||||||
from tests import HubMock
|
from tests import HubMock
|
||||||
@ -56,17 +57,18 @@ def circles():
|
|||||||
|
|
||||||
|
|
||||||
def square_spiral():
|
def square_spiral():
|
||||||
rounds = 7
|
rounds = 5
|
||||||
step = plotter.base_speed / rounds / 3.0
|
step = plotter.base_speed / rounds / 5.0
|
||||||
for r in range(1, rounds):
|
for r in range(1, rounds):
|
||||||
plotter.line(step * r * 4, 0)
|
plotter.line(step * r * 4, 0)
|
||||||
plotter.line(0, step * (r * 4 + 1))
|
plotter.line(0, step * (r * 4 + 1))
|
||||||
plotter.line(-step * (r * 4 + 2), 0)
|
plotter.line(-step * (r * 4 + 2), 0)
|
||||||
plotter.line(0, -step * (r * 4 + 3))
|
plotter.line(0, -step * (r * 4 + 3))
|
||||||
|
plotter.line(step * 2.0, step * 2.0) # cut
|
||||||
|
|
||||||
|
|
||||||
def christmas_tree():
|
def christmas_tree():
|
||||||
t = FIELD_WIDTH / 5
|
t = FIELD_WIDTH / 3
|
||||||
plotter.line(t, t)
|
plotter.line(t, t)
|
||||||
plotter.line(-t * 0.5, 0)
|
plotter.line(-t * 0.5, 0)
|
||||||
plotter.line(t, t)
|
plotter.line(t, t)
|
||||||
@ -208,12 +210,14 @@ if __name__ == '__main__':
|
|||||||
try:
|
try:
|
||||||
plotter.initialize()
|
plotter.initialize()
|
||||||
|
|
||||||
|
snowflake(0.75)
|
||||||
|
# christmas_tree()
|
||||||
|
# square_spiral()
|
||||||
|
# lego(plotter, FIELD_WIDTH / 7.0)
|
||||||
|
|
||||||
# plotter._tool_down()
|
# plotter._tool_down()
|
||||||
|
|
||||||
# angles_experiment()
|
# angles_experiment()
|
||||||
|
|
||||||
# try_speeds()
|
# try_speeds()
|
||||||
|
|
||||||
# moves()
|
# moves()
|
||||||
# triangle()
|
# triangle()
|
||||||
# square()
|
# square()
|
||||||
@ -223,10 +227,6 @@ if __name__ == '__main__':
|
|||||||
# plotter.spiral(4, 0.02)
|
# plotter.spiral(4, 0.02)
|
||||||
# plotter.rectangle(FIELD_WIDTH / 5.0, FIELD_WIDTH / 5.0, solid=True)
|
# plotter.rectangle(FIELD_WIDTH / 5.0, FIELD_WIDTH / 5.0, solid=True)
|
||||||
|
|
||||||
# square_spiral()
|
|
||||||
snowflake(0.75)
|
|
||||||
# christmas_tree()
|
|
||||||
# lego(plotter, FIELD_WIDTH / 5.0)
|
|
||||||
pass
|
pass
|
||||||
finally:
|
finally:
|
||||||
plotter.finalize()
|
plotter.finalize()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user