mirror of
https://github.com/undera/pylgbst.git
synced 2020-11-18 19:37:26 -08:00
Prepare to conflict
This commit is contained in:
parent
abd502b70c
commit
7bcba47de5
@ -27,10 +27,14 @@ for device in hub.devices:
|
||||
|
||||
## Debug Server
|
||||
|
||||
`sudo python -c "from pylgbst.comms import *; import logging; logging.basicConfig(level=logging.DEBUG); DebugServer(BLEConnection().connect()).start()"`
|
||||
```
|
||||
sudo python -c "from pylgbst.comms import *; import logging; logging.basicConfig(level=logging.DEBUG); DebugServer(BLEConnection().connect()).start()"
|
||||
```
|
||||
|
||||
## Roadmap
|
||||
|
||||
- make notifications from pygattlib to quickly get into parallel thread, to avoid segfaults
|
||||
- support working with push button
|
||||
- Give nice documentation examples, don't forget to mention logging
|
||||
- make angled motors to be synchronous by default => 3-state status
|
||||
- make sure unit tests cover all important code
|
||||
|
2
demo.py
2
demo.py
@ -168,7 +168,7 @@ if __name__ == '__main__':
|
||||
|
||||
hub = MoveHub(connection)
|
||||
|
||||
demo_motor_sensors(hub)
|
||||
demo_motors_timed(hub)
|
||||
# demo_all(hub)
|
||||
|
||||
log.info("Sleeping 60s")
|
||||
|
@ -62,9 +62,6 @@ class MoveHub(object):
|
||||
return self.connection.read(DEVICE_NAME)
|
||||
|
||||
def _notify(self, handle, data):
|
||||
"""
|
||||
Using https://github.com/JorgePe/BOOSTreveng/blob/master/Notifications.md
|
||||
"""
|
||||
orig = data
|
||||
|
||||
if handle != MOVE_HUB_HARDWARE_HANDLE:
|
||||
|
@ -30,8 +30,9 @@ class Vernie(MoveHub):
|
||||
def _color_distance_data(self, color, distance):
|
||||
log.debug("Color & Distance data: %s %s", COLORS[color], distance)
|
||||
self._sensor_distance = distance
|
||||
self._color_detected = color
|
||||
self.led.set_color(self._color_detected if self._color_detected != COLOR_NONE else COLOR_BLACK)
|
||||
if self._color_detected != color:
|
||||
self._color_detected = color
|
||||
self.led.set_color(self._color_detected if self._color_detected != COLOR_NONE else COLOR_BLACK)
|
||||
|
||||
def head_to(self, direction=RIGHT, speed=0.25, angle=25):
|
||||
if direction == STRAIGHT:
|
||||
|
Loading…
x
Reference in New Issue
Block a user