|
15 | 15 | }, |
16 | 16 | { |
17 | 17 | "cell_type": "code", |
18 | | - "execution_count": 6, |
| 18 | + "execution_count": null, |
19 | 19 | "id": "762d552a-dafd-4b4b-9b0c-8b6612d2415b", |
20 | 20 | "metadata": { |
21 | 21 | "scrolled": true |
22 | 22 | }, |
23 | 23 | "outputs": [], |
24 | 24 | "source": [ |
25 | | - "import asyncio \n", |
26 | | - "from bluetooth_manager import MoveHubWidget,LedColor,Port, Sensor\n", |
| 25 | + "import asyncio\n", |
| 26 | + "from jupyter_bluetooth_manager import MoveHubWidget,LedColor,Port, Sensor\n", |
27 | 27 | "from ipywidgets import Output\n", |
28 | 28 | "from IPython.display import display\n", |
29 | 29 | "\n", |
30 | 30 | "# the robot's LED supports the following colors\n", |
31 | 31 | "colors = [\n", |
32 | | - " \n", |
| 32 | + "\n", |
33 | 33 | " LedColor.pink,\n", |
34 | 34 | " LedColor.purple,\n", |
35 | 35 | " LedColor.blue,\n", |
|
53 | 53 | }, |
54 | 54 | { |
55 | 55 | "cell_type": "code", |
56 | | - "execution_count": 7, |
| 56 | + "execution_count": null, |
57 | 57 | "id": "aae633ad-bbb2-45c2-a1ff-5fab18146172", |
58 | 58 | "metadata": { |
59 | 59 | "scrolled": true |
|
76 | 76 | ], |
77 | 77 | "source": [ |
78 | 78 | "# number of concurrent \"lanes\"\n", |
79 | | - "n_lanes = 4 \n", |
| 79 | + "n_lanes = 4\n", |
80 | 80 | "widget = MoveHubWidget(n_lanes=n_lanes)\n", |
81 | 81 | "output = Output()\n", |
82 | 82 | "display(widget)" |
|
179 | 179 | "d_forward = 200\n", |
180 | 180 | "d_rotate = 300\n", |
181 | 181 | "output = Output()\n", |
182 | | - "async def main(lane,log, identifier): \n", |
| 182 | + "async def main(lane,log, identifier):\n", |
183 | 183 | " for i in range(4):\n", |
184 | 184 | " await lane.set_led_async(\"red\")\n", |
185 | 185 | " await lane.motor_angle_multi_async(angle=d_forward, power_a=speed,power_b=speed)\n", |
186 | 186 | " await lane.set_led_async(\"green\")\n", |
187 | 187 | " await lane.motor_angle_multi_async(angle=d_rotate, power_a=speed,power_b=-1.0*speed)\n", |
188 | | - " \n", |
| 188 | + "\n", |
189 | 189 | "widget.run_async_program(main, output=output);\n", |
190 | 190 | "output" |
191 | 191 | ] |
|
0 commit comments