Skip to content

Commit 5fd8764

Browse files
authored
Merge pull request #2336 from arduino/karlsoderby/final-changes
fixes on review
2 parents 8caedb7 + 66e8593 commit 5fd8764

File tree

13 files changed

+36
-69
lines changed

13 files changed

+36
-69
lines changed

content/micropython/00.first-steps/01.install-guide/installing-micropython.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,10 @@ MicroPython is officially supported on several Arduino boards. Here’s a list o
2424
- [Portenta H7](https://store.arduino.cc/products/portenta-h7)
2525
- [Portenta H7 Lite](https://store.arduino.cc/products/portenta-h7-lite)
2626
- [Portenta H7 Lite Connected](https://store.arduino.cc/products/portenta-h7-lite-connected)
27-
- [Opta](https://store.arduino.cc/products/opta)
28-
- [Opta Wifi](https://store.arduino.cc/products/opta-wifi)
29-
- [Opta RS485](https://store.arduino.cc/products/opta-rs485)
3027
- [Arduino Nano RP2040 Connect](https://store.arduino.cc/products/arduino-nano-rp2040-connect)
3128
- [Nicla Vision](https://store.arduino.cc/products/nicla-vision)
3229
- [Arduino Nano 33 BLE](https://store.arduino.cc/products/arduino-nano-33-ble)
33-
- [Arduino Nano 33 BLE Rev2](https://store.arduino.cc/products/arduino-nano-33-ble-rev2)
34-
- [Arduino Nano 33 BLE Sense](https://store.arduino.cc/products/arduino-nano-33-ble-sense)
30+
- [Arduino Nano 33 BLE Rev2](https://store.arduino.cc/products/nano-33-ble-rev2)
3531
- [Arduino Nano 33 BLE Sense Rev2](https://store.arduino.cc/products/arduino-nano-33-ble-sense-rev2)
3632
- [Arduino Nano ESP32](https://store.arduino.cc/products/arduino-nano-esp32)
3733

content/micropython/00.first-steps/02.first-script/first-script.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,10 @@ MicroPython is officially supported on several Arduino boards. Here’s a list o
2121
- [Portenta H7](https://store.arduino.cc/products/portenta-h7)
2222
- [Portenta H7 Lite](https://store.arduino.cc/products/portenta-h7-lite)
2323
- [Portenta H7 Lite Connected](https://store.arduino.cc/products/portenta-h7-lite-connected)
24-
- [Opta](https://store.arduino.cc/products/opta)
25-
- [Opta Wifi](https://store.arduino.cc/products/opta-wifi)
26-
- [Opta RS485](https://store.arduino.cc/products/opta-rs485)
2724
- [Arduino Nano RP2040 Connect](https://store.arduino.cc/products/arduino-nano-rp2040-connect)
2825
- [Nicla Vision](https://store.arduino.cc/products/nicla-vision)
2926
- [Arduino Nano 33 BLE](https://store.arduino.cc/products/arduino-nano-33-ble)
30-
- [Arduino Nano 33 BLE Rev2](https://store.arduino.cc/products/arduino-nano-33-ble-rev2)
31-
- [Arduino Nano 33 BLE Sense](https://store.arduino.cc/products/arduino-nano-33-ble-sense)
27+
- [Arduino Nano 33 BLE Rev2](https://store.arduino.cc/products/nano-33-ble-rev2)
3228
- [Arduino Nano 33 BLE Sense Rev2](https://store.arduino.cc/products/arduino-nano-33-ble-sense-rev2)
3329
- [Arduino Nano ESP32](https://store.arduino.cc/products/arduino-nano-esp32)
3430

content/micropython/01.basics/00.digital-io/digital-io.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,10 @@ MicroPython is officially supported on several Arduino boards. Here’s a list o
3232
- [Portenta H7](https://store.arduino.cc/products/portenta-h7)
3333
- [Portenta H7 Lite](https://store.arduino.cc/products/portenta-h7-lite)
3434
- [Portenta H7 Lite Connected](https://store.arduino.cc/products/portenta-h7-lite-connected)
35-
- [Opta](https://store.arduino.cc/products/opta)
36-
- [Opta Wifi](https://store.arduino.cc/products/opta-wifi)
37-
- [Opta RS485](https://store.arduino.cc/products/opta-rs485)
3835
- [Arduino Nano RP2040 Connect](https://store.arduino.cc/products/arduino-nano-rp2040-connect)
3936
- [Nicla Vision](https://store.arduino.cc/products/nicla-vision)
4037
- [Arduino Nano 33 BLE](https://store.arduino.cc/products/arduino-nano-33-ble)
41-
- [Arduino Nano 33 BLE Rev2](https://store.arduino.cc/products/arduino-nano-33-ble-rev2)
42-
- [Arduino Nano 33 BLE Sense](https://store.arduino.cc/products/arduino-nano-33-ble-sense)
38+
- [Arduino Nano 33 BLE Rev2](https://store.arduino.cc/products/nano-33-ble-rev2)
4339
- [Arduino Nano 33 BLE Sense Rev2](https://store.arduino.cc/products/arduino-nano-33-ble-sense-rev2)
4440
- [Arduino Nano ESP32](https://store.arduino.cc/products/arduino-nano-esp32)
4541

content/micropython/01.basics/01.analog-io/analog-io.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,10 @@ MicroPython is officially supported on several Arduino boards. Here’s a list o
2525
- [Portenta H7](https://store.arduino.cc/products/portenta-h7)
2626
- [Portenta H7 Lite](https://store.arduino.cc/products/portenta-h7-lite)
2727
- [Portenta H7 Lite Connected](https://store.arduino.cc/products/portenta-h7-lite-connected)
28-
- [Opta](https://store.arduino.cc/products/opta)
29-
- [Opta Wifi](https://store.arduino.cc/products/opta-wifi)
30-
- [Opta RS485](https://store.arduino.cc/products/opta-rs485)
3128
- [Arduino Nano RP2040 Connect](https://store.arduino.cc/products/arduino-nano-rp2040-connect)
3229
- [Nicla Vision](https://store.arduino.cc/products/nicla-vision)
3330
- [Arduino Nano 33 BLE](https://store.arduino.cc/products/arduino-nano-33-ble)
34-
- [Arduino Nano 33 BLE Rev2](https://store.arduino.cc/products/arduino-nano-33-ble-rev2)
35-
- [Arduino Nano 33 BLE Sense](https://store.arduino.cc/products/arduino-nano-33-ble-sense)
31+
- [Arduino Nano 33 BLE Rev2](https://store.arduino.cc/products/nano-33-ble-rev2)
3632
- [Arduino Nano 33 BLE Sense Rev2](https://store.arduino.cc/products/arduino-nano-33-ble-sense-rev2)
3733
- [Arduino Nano ESP32](https://store.arduino.cc/products/arduino-nano-esp32)
3834

content/micropython/01.basics/02.loops/loops.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,10 @@ MicroPython is officially supported on several Arduino boards. Here’s a list o
2222
- [Portenta H7](https://store.arduino.cc/products/portenta-h7)
2323
- [Portenta H7 Lite](https://store.arduino.cc/products/portenta-h7-lite)
2424
- [Portenta H7 Lite Connected](https://store.arduino.cc/products/portenta-h7-lite-connected)
25-
- [Opta](https://store.arduino.cc/products/opta)
26-
- [Opta Wifi](https://store.arduino.cc/products/opta-wifi)
27-
- [Opta RS485](https://store.arduino.cc/products/opta-rs485)
2825
- [Arduino Nano RP2040 Connect](https://store.arduino.cc/products/arduino-nano-rp2040-connect)
2926
- [Nicla Vision](https://store.arduino.cc/products/nicla-vision)
3027
- [Arduino Nano 33 BLE](https://store.arduino.cc/products/arduino-nano-33-ble)
31-
- [Arduino Nano 33 BLE Rev2](https://store.arduino.cc/products/arduino-nano-33-ble-rev2)
32-
- [Arduino Nano 33 BLE Sense](https://store.arduino.cc/products/arduino-nano-33-ble-sense)
28+
- [Arduino Nano 33 BLE Rev2](https://store.arduino.cc/products/nano-33-ble-rev2)
3329
- [Arduino Nano 33 BLE Sense Rev2](https://store.arduino.cc/products/arduino-nano-33-ble-sense-rev2)
3430
- [Arduino Nano ESP32](https://store.arduino.cc/products/arduino-nano-esp32)
3531

content/micropython/01.basics/03.data-logger/data-logger.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,10 @@ MicroPython is officially supported on several Arduino boards. Here’s a list o
2424
- [Portenta H7](https://store.arduino.cc/products/portenta-h7)
2525
- [Portenta H7 Lite](https://store.arduino.cc/products/portenta-h7-lite)
2626
- [Portenta H7 Lite Connected](https://store.arduino.cc/products/portenta-h7-lite-connected)
27-
- [Opta](https://store.arduino.cc/products/opta)
28-
- [Opta Wifi](https://store.arduino.cc/products/opta-wifi)
29-
- [Opta RS485](https://store.arduino.cc/products/opta-rs485)
3027
- [Arduino Nano RP2040 Connect](https://store.arduino.cc/products/arduino-nano-rp2040-connect)
3128
- [Nicla Vision](https://store.arduino.cc/products/nicla-vision)
3229
- [Arduino Nano 33 BLE](https://store.arduino.cc/products/arduino-nano-33-ble)
33-
- [Arduino Nano 33 BLE Rev2](https://store.arduino.cc/products/arduino-nano-33-ble-rev2)
34-
- [Arduino Nano 33 BLE Sense](https://store.arduino.cc/products/arduino-nano-33-ble-sense)
30+
- [Arduino Nano 33 BLE Rev2](https://store.arduino.cc/products/nano-33-ble-rev2)
3531
- [Arduino Nano 33 BLE Sense Rev2](https://store.arduino.cc/products/arduino-nano-33-ble-sense-rev2)
3632
- [Arduino Nano ESP32](https://store.arduino.cc/products/arduino-nano-esp32)
3733

content/micropython/02.environment/01.code-editor/code-editor.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ As we get familiar with the editor, remember that MicroPython has a few syntax r
2828

2929
The Arduino Lab for MicroPython editor provides several essential tools to make coding intuitive and efficient:
3030

31-
1.**Connect/Disconnect Board**: Use this button to connect or disconnect your MicroPython-compatible board. This allows the code editor to communicate with your board for running and testing code.
32-
2.**Run/Stop Script**: Click this button to run or stop your script. The output will be displayed in the REPL, providing immediate feedback or error messages.
33-
3.**File Management**: This option lets you manage files on your MicroPython board. You can upload, download, and organize your scripts.
34-
4.**Edit Script**: The main area of the editor where you write and modify your MicroPython code. It provides features like syntax highlighting to enhance readability.
35-
5.**Expand Terminal**: Use this button to expand or collapse the terminal section, which displays the REPL output, helping you debug and interact with your code in real time.
31+
1. **Connect/Disconnect Board**: Use this button to connect or disconnect your MicroPython-compatible board. This allows the code editor to communicate with your board for running and testing code.
32+
2. **Run/Stop Script**: Click this button to run or stop your script. The output will be displayed in the REPL, providing immediate feedback or error messages.
33+
3. **File Management**: This option lets you manage files on your MicroPython board. You can upload, download, and organize your scripts.
34+
4. **Edit Script**: The main area of the editor where you write and modify your MicroPython code. It provides features like syntax highlighting to enhance readability.
35+
5. **Expand Terminal**: Use this button to expand or collapse the terminal section, which displays the REPL output, helping you debug and interact with your code in real time.
3636

3737
![Overview of the code editor.](assets/IDEOverview.png)
3838

@@ -51,10 +51,10 @@ Managing files in the Arduino Lab for MicroPython is straightforward and allows
5151

5252
### REPL
5353

54-
The REPL can be found by expanding the terminal. Here you can interact with the terminal. The buttons allow for basic features like copy and pasting as the shortcuts like ```CTRL+C will´´´ not work on this window.
54+
The REPL can be found by expanding the terminal. Here you can interact with the terminal. The buttons allow for basic features like copy and pasting as the shortcuts like `CTRL+C will` not work on this window.
5555

5656
![The REPL.](assets/consoleTerminal.png)
57-
***For a detailed tutorial on using the file system, please refer to the [File System Tutorial](/micropython/environment/file-system).***
57+
***For a detailed tutorial on using the REPL, please refer to the [REPL Tutorial](/micropython/environment/repl).***
5858

5959
## Code Editor
6060

content/micropython/02.environment/02.file-system/file-system.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -52,26 +52,26 @@ To run code from a separate script in our `main.py` file, we can follow the inst
5252

5353
1. Create a file named `my_new_script.py`, and add the following function:
5454

55-
```python
56-
def test():
57-
print("This runs from my_new_script.py")
58-
```
55+
```python
56+
def test():
57+
print("This runs from my_new_script.py")
58+
```
5959

6060
2. In `main.py`, we run some initial code and then switches to executing a function from `my_new_script.py`. Here's an example:
6161

62-
```python
63-
import my_new_script
64-
print("This runs from main.py")
62+
```python
63+
import my_new_script
64+
print("This runs from main.py")
6565

66-
my_new_script.test()
67-
```
66+
my_new_script.test()
67+
```
6868

6969
3. Check the REPL, we should see:
7070

71-
```bash
72-
This runs from main.py # executed from main.py
73-
This runs from my_new_script #executed from my_new_script
74-
```
71+
```bash
72+
This runs from main.py # executed from main.py
73+
This runs from my_new_script #executed from my_new_script
74+
```
7575

7676
Essentially, this is how [modules](/micropython/environment/modules) work. You import a module, and use a function from that module.
7777

content/micropython/02.environment/04.runtime/runtime.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ MicroPython's runtime environment consists of several key components:
3232
1. **REPL (Read-Eval-Print Loop)**: One of the standout features of MicroPython's runtime is the REPL. The REPL is an interactive shell where we can type and execute Python code line by line, get immediate feedback, and test ideas quickly. It’s especially useful for debugging and learning how the hardware responds to different commands.
3333

3434
2. **Boot and Main Scripts**: When the microcontroller starts up, the MicroPython runtime automatically looks for two scripts:
35+
3536
- **`boot.py`**: This script is executed first and is typically used for system configuration, such as setting up Wi-Fi or initializing hardware settings.
3637
- **`main.py`**: After `boot.py` runs, `main.py` is executed. This is where we typically put our main application logic.
3738

3839
3. **Concurrency with `uasyncio`**: MicroPython provides support for asynchronous programming using the `uasyncio` module. This allows us to handle multiple tasks concurrently, such as reading a sensor while controlling an LED, without blocking the main program.
3940

40-
### Micro vs Python
41+
### MicroPython vs Python
4142

4243
While MicroPython aims to be as compatible as possible with standard Python, there are some important differences due to the limited resources available on microcontrollers:
4344

content/micropython/02.environment/05.repl/repl.md

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ In this guide, we’ll go through how the REPL functions, why it’s useful, and
1111

1212
## What is REPL?
1313

14+
![REPL.](assets/replcover.png)
15+
1416
The REPL process involves four basic steps:
1517

1618
- **R - ead**: Reads and accepts your code input line-by-line.
@@ -46,6 +48,8 @@ When writing `name` in the REPL, (after `name = "Pedro"`), we should get:
4648
'Pedro'
4749
```
4850

51+
![How the REPL works.](assets/replgif.gif)
52+
4953
## Example: Perform a Calculation in the REPL
5054

5155
Now let's create a REPL session that performs a calculation, by adding two numbers together:

content/micropython/04.board-examples/nano-ble-sense/nano-ble-sense.md

+3-9
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ The Nano BLE Sense has a number of board-specific features that can be accessed
2828
- **Microphone (MP34DT05)** - a microphone for recording audio samples.
2929
- **Gesture Sensor (APDS9960)** - measure ambient light and proximity.
3030
- **Pressure Sensor (LPS22)** - measure air pressure for weather applications.
31-
- **Temperature and Humidity (HTS221 & HS3003)** - record temperature and relative humidity.
32-
- **IMU (LSM9DS1, BMI270 + BMM150)** - read gyroscope and accelerometer data.
33-
34-
***Note that there are multiple revisions of the Nano BLE Sense (Rev1 and Rev2), where different sensors are used.***
31+
- **Temperature and Humidity - HTS221 (Rev1), HS3003 (Rev2)** - record temperature and relative humidity.
32+
- **IMU - LSM9DS1 (Rev1), BMI270 + BMM150 (Rev2)** - read gyroscope and accelerometer data.
3533

3634
## RGB LED
3735

@@ -315,8 +313,6 @@ data = uart.read()
315313
print("Received:", data)
316314
```
317315

318-
***Read more about SPI in [this article](/micropython/communication/spi).***
319-
320316
### SPI
321317

322318
The Nano BLE Sense supports **SPI** through the following pins:
@@ -334,6 +330,4 @@ from machine import Pin, SPI
334330
spi = SPI(1, baudrate=1000000, polarity=0, phase=0, sck=Pin(18), mosi=Pin(23), miso=Pin(19))
335331

336332
print("SPI initialized")
337-
```
338-
339-
***Read more about UART in [this article](/micropython/communication/uart).***
333+
```

content/micropython/04.board-examples/nano-esp32/nano-esp32.md

-4
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ data = uart.read()
9999
print("Received:", data)
100100
```
101101

102-
***Read more about UART in [this article](/micropython/communication/uart).***
103-
104102
### SPI
105103

106104
SPI communication is also supported on the Nano ESP32, which is useful for high-speed data transfer with peripherals:
@@ -114,8 +112,6 @@ spi = SPI(1, baudrate=1000000, polarity=0, phase=0, sck=Pin(18), mosi=Pin(23), m
114112
print("SPI initialized")
115113
```
116114

117-
***Read more about SPI in [this article](/micropython/communication/spi).***
118-
119115
## Additional Features
120116

121117
The Nano ESP32 includes other features that can be explored:

content/micropython/04.board-examples/nano-rp2040-connect/nano-rp2040-connect.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,6 @@ data = uart.read()
186186
print("Received:", data)
187187
```
188188

189-
***Read more about SPI in [this article](/micropython/communication/spi).***
190-
191189
### SPI
192190

193191
The Nano RP2040 Connect supports **SPI** through the following pins:
@@ -205,6 +203,4 @@ from machine import Pin, SPI
205203
spi = SPI(1, baudrate=1000000, polarity=0, phase=0, sck=Pin(18), mosi=Pin(23), miso=Pin(19))
206204

207205
print("SPI initialized")
208-
```
209-
210-
***Read more about UART in [this article](/micropython/communication/uart).***
206+
```

0 commit comments

Comments
 (0)