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/hardware/04.pro/boards/portenta-h7/tutorials/getting-started-openmv-micropython/content.md
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -38,13 +38,13 @@ The OpenMV IDE is meant to provide an Arduino like experience for simple machine
38
38
39
39
## Instructions
40
40
41
-
Using the OpenMV IDE you can run [MicroPython](http://docs.MicroPython.org/en/latest/) scripts on the Portenta H7 board. MicroPython provides a lot of classes and modules that make it easy to quickly explore the features of the Portenta H7. In this tutorial you will first download the OpenMV IDE and set up the development environment. [Here](https://openmv.io/) you can read more about the OpenMV IDE. OpenMV comes with its own firmware that is built on MicroPython. You will then learn to write a simple script that will blink the on-board RGB LED using some basic MicroPython commands.
41
+
Using the OpenMV IDE, you can run [MicroPython](http://docs.MicroPython.org/en/latest/) scripts on the Portenta H7 board. MicroPython provides a lot of classes and modules that make it easy to quickly explore the features of the Portenta H7. In this tutorial, you will first download the OpenMV IDE and set up the development environment. [Here](https://openmv.io/) you can read more about the OpenMV IDE. OpenMV comes with its own firmware that is built on MicroPython. You will then learn to write a simple script that will blink the on-board RGB LED using some basic MicroPython commands.
42
42
43
43
### 1. Downloading the OpenMV IDE
44
44
45
-
Before you can start programming OpenMV scripts for the Portenta you need to download and install the OpenMV IDE.
45
+
Before you can start programming OpenMV scripts for the Portenta, you need to download and install the OpenMV IDE.
46
46
47
-
***IMPORTANT: Please make sure to update the bootloader to the most recent version to benefit from the latest improvements. Follow [these steps](/tutorials/portenta-h7/updating-the-bootloader) before you proceed with the next step of this tutorial.***
47
+
***IMPORTANT: Please make sure to update the bootloader to the most recent version to benefit from the latest improvements. Follow [these steps](https://docs.arduino.cc/tutorials/portenta-h7/updating-the-bootloader) before you proceed with the next step of this tutorial.***
48
48
49
49
50
50
Open the [OpenMV download](https://openmv.io/pages/download) page in your browser, download the version that you need for your operating system and follow the instructions of the installer.
@@ -67,13 +67,13 @@ A pop-up will ask you how you would like to proceed. Select "Reset Firmware to R
67
67
68
68

69
69
70
-
Portenta H7's green LED will start flashing while the OpenMV firmware is being uploaded to the board. A terminal window will open which shows you the flashing progress. Wait until the green LED stops flashing and fading. You will see a message saying "DFU firmware update complete!" when the process is done.
70
+
Portenta H7's green LED will start flashing while the OpenMV firmware is being uploaded to the board. A terminal window will open and show you the flashing progress. Wait until the green LED stops flashing and fading. You will see a message saying "DFU firmware update complete!" when the process is done.
71
71
72
72

73
73
74
-
***Installing the OpenMV firmware will overwrite any existing sketches in the internal Flash of Portenta H7. Also the M7 port won't be exposed in the Arduino IDE anymore. To re-flash the M7 with an Arduino firmware you need to put the board into bootloader mode. To do so double press the reset button on the Portenta H7 board. The built-in green LED will start fading in and out. In bootloader mode you will see the Portenta M7 port again in the Arduino IDE.***
74
+
***Installing the OpenMV firmware will overwrite any existing sketches in the internal Flash of Portenta H7. Also the M7 port will not be exposed in the Arduino IDE anymore. To re-flash the M7 with an Arduino firmware you need to put the board into bootloader mode. To do so, double press the reset button on the Portenta H7 board. The built-in green LED will start fading in and out. In bootloader mode you will see the Portenta M7 port again in the Arduino IDE.***
75
75
76
-
The board will start flashing its blue LED when it's ready to be connected. After confirming the completion dialog the Portenta H7 should already be connected to the OpenMV IDE, otherwise click the "connect" button (plug symbol) once again.
76
+
The board will start flashing its blue LED when it is ready to be connected. After confirming the completion dialog, the Portenta H7 should already be connected to the OpenMV IDE, otherwise click the "connect" button (plug symbol) once again.
77
77
78
78

79
79
@@ -85,21 +85,21 @@ Create a new script by clicking the "New File" button in the toolbar on the left
85
85
import pyb # Import module for board related functions
86
86
```
87
87
88
-
A module in Python is a confined bundle of functionality. By importing it into the script it gets made available. For this example we only need `pyb`, which is a module that contains board related functionality such as PIN handling. You can read more about its functions [here](https://docs.micropython.org/en/latest/library/pyb.html).
88
+
A module in Python is a confined bundle of functionality. By importing it into the script, it gets made available. For this example, you only need `pyb`, which is a module that contains board related functionality such as PIN handling. You can read more about its functions [here](https://docs.micropython.org/en/latest/library/pyb.html).
89
89
90
-
Now we can create the variables that will control our built-in RGB LED. With `pyb`we can easily control each color.
90
+
Now you can create the variables that will control our built-in RGB LED. With `pyb`you can easily control each color.
91
91
92
92
```python
93
93
redLED = pyb.LED(1) # built-in red LED
94
94
greenLED = pyb.LED(2) # built-in green LED
95
95
blueLED = pyb.LED(3) # built-in blue LED
96
96
```
97
97
98
-
Now we can easily distinguish between which color we control in the script.
98
+
Now you can easily distinguish between which color we control in the script.
99
99
100
100
### 4. Creating the Main Loop in the Script
101
101
102
-
Putting our code inside a while loop will make the code run continuously. In the loop we turn on an LED with `on`, then we use the `delay` function to create a delay. This function will wait with execution of the next instruction in the script. The duration of the delay can be controlled by changing the value inside the parentheses. The number defines how many milliseconds the board will wait. After the specified time has passed, we turn off the LED with the `off` function. We repeat that for each color.
102
+
Putting your code inside a while loop will make the code run continuously. In the loop you can turn on an LED with `on`, then you can use the `delay` function to create a delay. This function will wait with execution of the next instruction in the script. The duration of the delay can be controlled by changing the value inside the parentheses. The number defines how many milliseconds the board will wait. After the specified time has passed, you can turn off the LED with the `off` function. You can repeat that for each color.
103
103
104
104
```python
105
105
whileTrue:
@@ -162,14 +162,14 @@ In this tutorial you learned how to use the OpenMV IDE with your Portenta board.
162
162
### Next Steps
163
163
164
164
- Experiment with MicroPythons capabilities. If you want some examples of what to do, take a look at the examples included in the OpenMV IDE. Go to: **File > Examples > Arduino > Portenta H7** in the OpenMV IDE.
165
-
- Take a look at our other Portenta H7 tutorials which showcase its many uses. You can find them [here](https://docs.arduino.cc/hardware/portenta-h7#tutorials).
165
+
- Take a look at the other Portenta H7 tutorials which showcase its many uses. You can find them [here](https://docs.arduino.cc/hardware/portenta-h7#tutorials).
166
166
167
167
## Troubleshooting
168
168
169
169
### OpenMV Firmware Flashing Issues
170
170
171
171
- If the upload of the OpenMV firmware fails during the download, put the board back in bootloader mode and try again. Repeat until the firmware gets successfully uploaded.
172
-
- If the OpenMV IDE still can't connect after flashing the firmware, try uploading the latest firmware using the "Load Specific Firmware File" option. You can find the latest firmware in the [OpenMV Github repository](https://github.com/openmv/openmv/releases). Look for a file named **firmware.bin** in the PORTENTA folder.
172
+
- If the OpenMV IDE still cannot connect after flashing the firmware, try uploading the latest firmware using the "Load Specific Firmware File" option. You can find the latest firmware in the [OpenMV Github repository](https://github.com/openmv/openmv/releases). Look for a file named **firmware.bin** in the PORTENTA folder.
173
173
- If you experience issues putting the board in bootloader mode, make sure you first update the bootloader to the latest version using the **STM32H747_updateBootloader** sketch from the examples menu in the Arduino IDE.
174
174
- If you see a "OSError: Reset Failed" message, reset the board by pressing the reset button. Wait until you see the blue LED flashing, connect the board to the OpenMV IDE and try running the script again.
175
175
- In bootloader versions 17 and older there was a bug that could put the Portenta into a boot loop when the transmission aborted while flashing a large firmware file. This was fixed in the bootloader version 18.
0 commit comments