Skip to content

Commit 82b4f5a

Browse files
authored
1.8.97 (#1091)
1 parent 6b47e96 commit 82b4f5a

File tree

3 files changed

+38
-41
lines changed

3 files changed

+38
-41
lines changed

content/learn/03.programming/05.arduino-and-python/arduino-and-python.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
author: 'Karl Söderby'
33
title: 'MicroPython with Arduino Boards'
44
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-
tags:
5+
tags:
66
- MicroPython
77
- Arduino Lab
88
- OpenMV
@@ -11,7 +11,7 @@ hero_position: 1
1111

1212
***To download the firmware required to run MicroPython on your Arduino board, visit the [Arduino MicroPython downloads page](/micropython).***
1313

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+
[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**.
1515

1616
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).
1717

@@ -44,22 +44,22 @@ As MicroPython is already running on the board, we don't need to compile and upl
4444

4545
![Arduino Lab for MicroPython Editor](assets/mpylabs-ss.png)
4646

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.
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.
4848

4949
- [Download Arduino Lab for MicroPython Editor](https://labs.arduino.cc/en/labs/micropython).
5050
- [MicroPython Firmware downloads page](/micropython).
5151

5252
## OpenMV Editor
5353

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.
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.
5555

5656
OpenMV is a great platform for computer vision and machine learning projects.
5757

5858
![The OpenMV editor.](assets/openmv-ss.png)
5959

6060
### OpenMV Examples
6161

62-
Further down this article, you can find a lot of useful code examples that will help you to get started.
62+
Further down this article, you can find a lot of useful code examples that will help you to get started.
6363

6464
***You can also check out the full list of examples in the [OpenMV's GitHub repository](https://github.com/openmv/openmv/tree/master/scripts/examples/10-Arduino-Boards).***
6565

@@ -84,7 +84,7 @@ All of above are also compatible with the **OpenMV IDE**.
8484
If you need help getting started with MicroPython on the **Nano 33 BLE** board, you can check out the tutorials below:
8585

8686
- [Install MicroPython on your Nano BLE](/tutorials/nano-33-ble-sense/micropython-installation#arduino-nano-33-ble).
87-
- [Getting started with OpenMV and Nano 33 BLE](/tutorials/nano-33-ble/getting-started-omv)
87+
- [Getting started with OpenMV and Nano 33 BLE](/tutorials/nano-33-ble/getting-started-omv)
8888
- [Nano 33 BLE Python® API guide](/tutorials/nano-33-ble/ble-python-api) (a collection of useful scripts).
8989

9090
***To reset the bootloader on the Nano 33 BLE board, double tap the reset button quickly. This will reset your board to factory setting.***
@@ -93,7 +93,7 @@ If you need help getting started with MicroPython on the **Nano 33 BLE** board,
9393

9494
![The Nano 33 BLE + BLE Sense](assets/hero-ble-sense.png)
9595

96-
If you need help getting started with MicroPython on the **Nano 33 BLE Sense** board, you can check out the tutorials below:
96+
If you need help getting started with MicroPython on the **Nano 33 BLE Sense** board, you can check out the tutorials below:
9797

9898
- [Install MicroPython on your Nano BLE Sense](/tutorials/nano-33-ble-sense/micropython-installation#arduino-nano-33-ble).
9999
- [Getting started with OpenMV and Nano 33 BLE Sense](/tutorials/nano-33-ble-sense/getting-started-omv)
@@ -107,14 +107,14 @@ If you need help getting started with MicroPython on the **Nano 33 BLE Sense** b
107107

108108
If you need help getting started with MicroPython on the **Nano RP2040 Connect** board, you can check out the tutorials below:
109109

110-
- [Install MicroPython on your Nano RP2040 Connect](/tutorials/nano-rp2040-connect/micropython-installation#arduino-nano-rp2040-connect)
110+
- [Install MicroPython on your Nano RP2040 Connect](/tutorials/nano-rp2040-connect/micropython-installation#arduino-nano-rp2040-connect)
111111
- [Nano RP2040 Connect Python® guide](/tutorials/nano-rp2040-connect/rp2040-python-api)
112112
- [Getting Started with OpenMV and MicroPython on Nano RP2040 Connect](/tutorials/nano-rp2040-connect/rp2040-openmv-setup)
113113

114114

115115
***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).***
116116

117-
### GIGA R1
117+
### GIGA R1
118118

119119
![The GIGA R1](./assets/giga-r1.png)
120120

@@ -180,7 +180,7 @@ while True:
180180

181181
### Functions
182182

183-
This script prints `"Hello world!"` every second. In addition, `counter_function()` also
183+
This script prints `"Hello world!"` every second. In addition, `counter_function()` also
184184

185185
```python
186186
import time
@@ -222,11 +222,11 @@ while True:
222222
for x in range(10):
223223
function_increase()
224224
time.sleep(1)
225-
225+
226226
for x in range(10):
227227
function_decrease()
228228
time.sleep(1)
229-
229+
230230
```
231231

232232
### Digital Write
@@ -242,7 +242,7 @@ p2 = Pin(25, Pin.OUT)
242242
while True:
243243
p2.value(0)
244244
print("off")
245-
utime.sleep(1)
245+
utime.sleep(1)
246246
p2.value(1)
247247
print("on")
248248
utime.sleep(1)
@@ -288,18 +288,18 @@ import time
288288

289289
# Make sure to follow the GPIO map for the board you are using.
290290
# Pin 29 in this case is the "A3" pin on the Nano BLE / BLE Sense
291-
adc_pin = machine.Pin(29)
291+
adc_pin = machine.Pin(29)
292292
adc = machine.ADC(adc_pin)
293293

294294
while True:
295-
reading = adc.read_u16()
295+
reading = adc.read_u16()
296296
print("ADC: ",reading)
297297
time.sleep_ms(500)
298298
```
299299

300300
### PWM
301301

302-
Write a specific duty to a specific pin.
302+
Write a specific duty to a specific pin.
303303

304304
```python
305305
from machine import Pin, PWM, ADC
@@ -327,7 +327,7 @@ while True:
327327

328328
### Interrupt
329329

330-
Below is an example of a simple interrupt that uses a pull up button and an LED.
330+
Below is an example of a simple interrupt that uses a pull up button and an LED.
331331

332332
The program blinks an LED, until the button is pressed. The button is attached to an interrupt, which turns off an LED for 3 seconds.
333333

@@ -336,25 +336,25 @@ import machine
336336
from machine import Pin
337337
import time
338338

339-
interrupt = False
340-
339+
interrupt = False
340+
341341
def callback(pin):
342342
global interrupt
343343
interrupt = True
344-
344+
345345
led = Pin(6, Pin.OUT)
346-
346+
347347
button = machine.Pin(25, machine.Pin.IN, machine.Pin.PULL_UP)
348-
348+
349349
button.irq(trigger=machine.Pin.IRQ_FALLING, handler=callback)
350-
350+
351351
while True:
352-
352+
353353
led.on()
354354
time.sleep(0.5)
355355
led.off()
356356
time.sleep(0.5)
357-
357+
358358
if interrupt:
359359
state = machine.disable_irq()
360360
machine.enable_irq(state)
@@ -363,4 +363,3 @@ while True:
363363
time.sleep(3)
364364
interrupt = False
365365
```
366-

package-lock.json

Lines changed: 12 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"homepage": "https://github.com/arduino/docs-content#readme",
2020
"dependencies": {
21-
"@arduino/docs-arduino-cc": "^1.8.92",
21+
"@arduino/docs-arduino-cc": "^1.8.97",
2222
"gatsby": "^4.9.2"
2323
},
2424
"volta": {

0 commit comments

Comments
 (0)