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
+25-26Lines changed: 25 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
author: 'Karl Söderby'
3
3
title: 'MicroPython with Arduino Boards'
4
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
-
tags:
5
+
tags:
6
6
- MicroPython
7
7
- Arduino Lab
8
8
- OpenMV
@@ -11,7 +11,7 @@ hero_position: 1
11
11
12
12
***To download the firmware required to run MicroPython on your Arduino board, visit the [Arduino MicroPython downloads page](/micropython).***
13
13
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**.
15
15
16
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
17
@@ -44,22 +44,22 @@ As MicroPython is already running on the board, we don't need to compile and upl
44
44
45
45

46
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.
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
48
49
49
-[Download Arduino Lab for MicroPython Editor](https://labs.arduino.cc/en/labs/micropython).
[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.
55
55
56
56
OpenMV is a great platform for computer vision and machine learning projects.
57
57
58
58

59
59
60
60
### OpenMV Examples
61
61
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.
63
63
64
64
***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).***
65
65
@@ -84,7 +84,7 @@ All of above are also compatible with the **OpenMV IDE**.
84
84
If you need help getting started with MicroPython on the **Nano 33 BLE** board, you can check out the tutorials below:
85
85
86
86
-[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)
88
88
-[Nano 33 BLE Python® API guide](/tutorials/nano-33-ble/ble-python-api) (a collection of useful scripts).
89
89
90
90
***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,
93
93
94
94

95
95
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:
97
97
98
98
-[Install MicroPython on your Nano BLE Sense](/tutorials/nano-33-ble-sense/micropython-installation#arduino-nano-33-ble).
99
99
-[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
107
107
108
108
If you need help getting started with MicroPython on the **Nano RP2040 Connect** board, you can check out the tutorials below:
109
109
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)
-[Getting Started with OpenMV and MicroPython on Nano RP2040 Connect](/tutorials/nano-rp2040-connect/rp2040-openmv-setup)
113
113
114
114
115
115
***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).***
116
116
117
-
### GIGA R1
117
+
### GIGA R1
118
118
119
119

120
120
@@ -180,7 +180,7 @@ while True:
180
180
181
181
### Functions
182
182
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
184
184
185
185
```python
186
186
import time
@@ -222,11 +222,11 @@ while True:
222
222
for x inrange(10):
223
223
function_increase()
224
224
time.sleep(1)
225
-
225
+
226
226
for x inrange(10):
227
227
function_decrease()
228
228
time.sleep(1)
229
-
229
+
230
230
```
231
231
232
232
### Digital Write
@@ -242,7 +242,7 @@ p2 = Pin(25, Pin.OUT)
242
242
whileTrue:
243
243
p2.value(0)
244
244
print("off")
245
-
utime.sleep(1)
245
+
utime.sleep(1)
246
246
p2.value(1)
247
247
print("on")
248
248
utime.sleep(1)
@@ -288,18 +288,18 @@ import time
288
288
289
289
# Make sure to follow the GPIO map for the board you are using.
290
290
# 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)
292
292
adc = machine.ADC(adc_pin)
293
293
294
294
whileTrue:
295
-
reading = adc.read_u16()
295
+
reading = adc.read_u16()
296
296
print("ADC: ",reading)
297
297
time.sleep_ms(500)
298
298
```
299
299
300
300
### PWM
301
301
302
-
Write a specific duty to a specific pin.
302
+
Write a specific duty to a specific pin.
303
303
304
304
```python
305
305
from machine import Pin, PWM, ADC
@@ -327,7 +327,7 @@ while True:
327
327
328
328
### Interrupt
329
329
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.
331
331
332
332
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.
0 commit comments