You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learn/03.programming/05.arduino-and-python/arduino-and-python.md
+33-14Lines changed: 33 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,21 @@
1
1
---
2
2
author: 'Karl Söderby'
3
-
title: 'Python with Arduino Boards'
4
-
description: 'Learn about compatibility between the popular Python language and Arduino boards, how to set up your environment, and discover in-depth tutorials and useful links.'
3
+
title: 'MicroPython with Arduino Boards'
4
+
description: 'Learn about compatibility between the popular MicroPython implementation and Arduino boards, how to set up your environment, and discover in-depth tutorials and useful links.'
5
5
tags:
6
-
- Python
6
+
- MicroPython
7
+
- Arduino Lab
7
8
- OpenMV
8
9
hero_position: 1
9
10
---
10
11
11
-
## Overview
12
+
***To download the firmware required to run MicroPython on your Arduino board, visit the [Arduino MicroPython downloads page](/micropython).***
12
13
13
-
[MicroPython](https://micropython.org/) is an implementation of the [Python programming language](https://www.python.org/) that comes with a subset of the Python standard library, and is designed **to run on microcontrollers**. A great advantage of using MicroPython is that it is easy to learn and has [great documentation](http://docs.micropython.org/en/latest/) for a number of boards. At the moment, there are four boards that can be used together with MicroPython, you can read more about them in the [compatible boards section](#compatible-boards).
14
+
[MicroPython](https://micropython.org/) is an implementation of the [Python programming language](https://www.python.org/) that comes with a subset of the Python standard library, and is designed **to run on microcontrollers**.
14
15
15
-
Arduino officially supports [OpenMV's branch of MicroPython](https://github.com/openmv/micropython), and through the [OpenMV IDE](https://openmv.io/pages/download) you can install MicroPython, connect/disconnect your board and upload your scripts
16
+
A great advantage of using MicroPython is that it is easy to learn and has [great documentation](http://docs.micropython.org/en/latest/) for a number of boards. At the moment, there are four boards that can be used together with MicroPython, you can read more about them in the [compatible boards section](#compatible-boards).
17
+
18
+
Arduino also supports [OpenMV's branch of MicroPython](https://github.com/openmv/micropython), and through the [OpenMV IDE](https://openmv.io/pages/download) you can install MicroPython, connect/disconnect your board and upload your scripts.
@@ -37,11 +40,22 @@ As MicroPython is already running on the board, we don't need to compile and upl
37
40
38
41
***When installing MicroPython on a board, it can only run MicroPython scripts, until we "uninstall" it. To put the board back in "normal mode" we need to reset the bootloader, which is a unique process for each board. These instructions are available in the [compatible boards](#micropython-compatible-boards) section in this article. Basically, you have to put the board in bootloader mode and upload any .ino sketch. ***
39
42
43
+
## Arduino Lab for MicroPython
44
+
45
+

46
+
47
+
The [Arduino Lab for MicroPython](https://labs.arduino.cc/en/labs/micropython) is a lightweight editor designed for simple interaction between your computer and board. With it, you can select your port, load scripts, and use the REPL shell and more.
48
+
49
+
-[Download Arduino Lab for MicroPython Editor](https://labs.arduino.cc/en/labs/micropython).
The Arduino IDE does not yet support Python. Instead, we can use [OpenMV](https://openmv.io/), a platform that supports programming Arduino boards with MicroPython. Through the OpenMV editor, we can install MicroPython, and upload scripts directly to the board. There's also a number of examples available directly in the editor.
54
+
[OpenMV](https://openmv.io/) is a platform that supports programming Arduino boards using a fork of MicroPython. Through the OpenMV editor, we can install this fork, and upload scripts directly to the board. There's also a number of examples available directly in the editor.
-[Getting Started with OpenMV and MicroPython on Nano RP2040 Connect](/tutorials/nano-rp2040-connect/rp2040-openmv-setup)
110
+
93
111
94
112
***To reset the bootloader, you will need to short to connect a jumper wire between the REC and GND pin, and press the reset button. More detailed instructions are available in the [Nano RP2040 Connect technical reference](/tutorials/nano-rp2040-connect/rp2040-01-technical-reference#board-not-detected).***
95
113
@@ -99,6 +117,7 @@ If you need help getting started with MicroPython on the **Nano RP2040 Connect**
99
117
100
118
If you need help getting started with MicroPython on the **Portenta H7** board, you can check out the tutorial below:
101
119
120
+
-[Install MicroPython on Portenta H7](/tutorials/portenta-h7/micropython-installation#arduino-portenta-h7).
102
121
-[Getting Started with OpenMV and MicroPython on Portenta H7](https://docs.arduino.cc/tutorials/portenta-h7/por-openmv-gs)
103
122
104
123
## Learn Python
@@ -122,7 +141,7 @@ This means it's time to learn the **Python** language, which there is a lot of r
122
141
123
142
Visit the [MicroPython documentation](https://docs.micropython.org/en/latest/) for an understanding on how Python runs on microcontrollers.
124
143
125
-
***Note that many examples will not work directly with Arduino boards, but will provide an understanding of how Python can run on a microcontroller.***
144
+
***Note that many examples in the MicroPython Docs will not work directly with Arduino boards, but will provide an understanding of how Python can run on your board.***
126
145
127
146
## API
128
147
@@ -166,7 +185,7 @@ while True:
166
185
time.sleep(1)
167
186
```
168
187
169
-
### For loop
188
+
### For Loop
170
189
171
190
Simple use of a for loop and functions. This script counts to 10, and then back to 0.
0 commit comments