Skip to content

Commit 1c1de48

Browse files
Update notebook.
1 parent 13ce3a2 commit 1c1de48

1 file changed

Lines changed: 23 additions & 18 deletions

File tree

examples/test-widget.ipynb renamed to examples/test-widget-with-xeus-python.ipynb

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,17 @@
1515
},
1616
{
1717
"cell_type": "code",
18-
"execution_count": null,
18+
"execution_count": 3,
1919
"id": "762d552a-dafd-4b4b-9b0c-8b6612d2415b",
2020
"metadata": {
2121
"scrolled": true
2222
},
2323
"outputs": [],
2424
"source": [
2525
"import asyncio\n",
26-
"from ipymovehub import MoveHubWidget, LedColor, Port, Sensor\n",
26+
"from ipymovehub import MoveHubWidget,LedColor,Port, Sensor\n",
2727
"from IPython.display import display\n",
28+
"from ipymovehub.movehub import MoveHubLaneProxy\n",
2829
"\n",
2930
"# the robot's LED supports the following colors\n",
3031
"colors = [\n",
@@ -51,7 +52,7 @@
5152
},
5253
{
5354
"cell_type": "code",
54-
"execution_count": null,
55+
"execution_count": 4,
5556
"id": "aae633ad-bbb2-45c2-a1ff-5fab18146172",
5657
"metadata": {
5758
"scrolled": true
@@ -60,7 +61,7 @@
6061
{
6162
"data": {
6263
"application/vnd.jupyter.widget-view+json": {
63-
"model_id": "5e916fd00a0542169e70cf4eb25f3aa9",
64+
"model_id": "46dcb1855d154b0f83c51e3805c65aea",
6465
"version_major": 2,
6566
"version_minor": 0
6667
},
@@ -81,10 +82,25 @@
8182
},
8283
{
8384
"cell_type": "code",
84-
"execution_count": null,
85+
"execution_count": 5,
8586
"id": "9b5f6086-3605-47ee-a170-57d3b97600e2",
8687
"metadata": {},
87-
"outputs": [],
88+
"outputs": [
89+
{
90+
"data": {
91+
"application/vnd.jupyter.widget-view+json": {
92+
"model_id": "c479d3e558384ef382f2660cbddd4d03",
93+
"version_major": 2,
94+
"version_minor": 0
95+
},
96+
"text/plain": [
97+
"Output()"
98+
]
99+
},
100+
"metadata": {},
101+
"output_type": "display_data"
102+
}
103+
],
88104
"source": [
89105
"# Case 1 : Execute this cell if there is no MoveHub connected\n",
90106
"widget.connect()"
@@ -112,7 +128,7 @@
112128
{
113129
"data": {
114130
"application/vnd.jupyter.widget-view+json": {
115-
"model_id": "5e916fd00a0542169e70cf4eb25f3aa9",
131+
"model_id": "46dcb1855d154b0f83c51e3805c65aea",
116132
"version_major": 2,
117133
"version_minor": 0
118134
},
@@ -150,17 +166,6 @@
150166
"text": [
151167
"LedColor.pink\n"
152168
]
153-
},
154-
{
155-
"ename": "AttributeError",
156-
"evalue": "'int' object has no attribute 'set_led_async'",
157-
"output_type": "error",
158-
"traceback": [
159-
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
160-
"\u001b[31mAttributeError\u001b[39m Traceback (most recent call last)",
161-
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[14]\u001b[39m\u001b[32m, line 6\u001b[39m\n\u001b[32m 2\u001b[39m lane = widget.n_lanes\n\u001b[32m 3\u001b[39m \u001b[38;5;28;01mfor\u001b[39;00m color \u001b[38;5;28;01min\u001b[39;00m colors:\n\u001b[32m 4\u001b[39m print(color)\n\u001b[32m 5\u001b[39m \u001b[38;5;66;03m#log(f\"set color to {color.value}\")\u001b[39;00m\n\u001b[32m----> \u001b[39m\u001b[32m6\u001b[39m \u001b[38;5;28;01mawait\u001b[39;00m lane.set_led_async(color)\n\u001b[32m 7\u001b[39m \u001b[38;5;28;01mawait\u001b[39;00m asyncio.sleep(\u001b[32m2\u001b[39m)\n",
162-
"\u001b[31mAttributeError\u001b[39m: 'int' object has no attribute 'set_led_async'"
163-
]
164169
}
165170
],
166171
"source": [

0 commit comments

Comments
 (0)