| Total Complexity | 6 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from itertools import cycle |
||
| 2 | from curio import sleep |
||
| 3 | from bricknil import attach, start |
||
| 4 | from bricknil.hub import DuploTrainHub |
||
| 5 | from bricknil.sensor import DuploTrainMotor |
||
| 6 | from bricknil.process import Process |
||
| 7 | from bricknil.const import Color |
||
| 8 | import logging |
||
| 9 | |||
| 10 | @attach(DuploTrainMotor, name='motor') |
||
| 11 | class Robot(DuploTrainHub): |
||
| 12 | |||
| 13 | async def hub_btn_change(self): |
||
| 14 | pass |
||
| 15 | async def vision_sensor_change(self): |
||
| 16 | pass |
||
| 17 | async def motor_change(self): |
||
| 18 | pass |
||
| 19 | async def tilt_sensor_change(self): |
||
| 20 | pass |
||
| 21 | |||
| 22 | async def run(self): |
||
| 23 | self.message_info("Running") |
||
| 24 | await sleep(20) # Give it enough time to gather data |
||
| 25 | self.message_info("Done") |
||
| 26 | |||
| 27 | self.message_info(self.port_info) |
||
| 28 | |||
| 29 | async def system(): |
||
| 30 | hub = Robot('robot', query_port_info=True) |
||
| 31 | |||
| 32 | if __name__ == '__main__': |
||
| 33 | logging.basicConfig(level=logging.DEBUG) |
||
| 34 | start(system) |
||
| 35 |