Skip to content

Karlsoderby/launch prep #2333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ MicroPython is a lightweight implementation of Python 3 designed to run on micro

![MicroPython with Arduino](assets/micropython-arduino.png)

When using MicroPython on Arduino boards, the software is first installed on your Arduino. This allows the board to interpret and run Python code. Once MicroPython is installed on your board (don't worry, we'll cover this [here]()), you can start writing and executing Python scripts instantly.
When using MicroPython on Arduino boards, the software is first installed on your Arduino. This allows the board to interpret and run Python code. Once MicroPython is installed on your board (don't worry, we'll cover this [here](/micropython/first-steps/install-guide)), you can start writing and executing Python scripts instantly.

Unlike traditional development approaches, where you compile code and then flash it to the board, with MicroPython you write Python scripts and run them instantly on your Arduino. This makes the development process much faster and more interactive.

Expand All @@ -38,7 +38,7 @@ The MicroPython installation includes several key components:

## How to Program for MicroPython

Programming in MicroPython involves writing Python scripts in a text editor and then running them on your board. For this, we can use the [Arduino Lab for MicroPython]().
Programming in MicroPython involves writing Python scripts in a text editor and then running them on your board. For this, we can use the [Arduino Lab for MicroPython](https://labs.arduino.cc/en/labs/micropython).

When writing MicroPython code, it's essential to think in terms of **modularity**. A good practice is to break down your code into smaller, reusable modules rather than writing everything in one large file. This approach makes it easier to manage and maintain code, especially for larger projects.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,6 @@ By following these steps, you should be able to successfully install MicroPython
### Next Steps

This tutorial is **Part Two** of the **"First Steps"** series. We recommend you following the next tutorial that will allow you to control the Arduino board's LED.
- [First Steps - Part Three]()
- [First Steps - My First Script](/micropython/first-steps/first-script)


Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ MicroPython is officially supported on several Arduino boards. Here’s a list o

## Board and Editor Setup

1. Open the [Arduino Lab for MicroPython]() application.
1. Open the [Arduino Lab for MicroPython](https://labs.arduino.cc/en/labs/micropython) application.
2. Plug the Arduino board into the computer using a USB cable.
![Connect board to computer.](assets/usb-comp.png)
3. Press the connection button on the top left corner of the window. The connected Arduino board should appear (by its port name), and we can click it:
![Connect to the board in the editor.](assets/select-board-ide.png)

***Need help installing MicroPython on your board? Visit the [MicroPython installation guide]().***
***Need help installing MicroPython on your board? Visit the [MicroPython installation guide](/micropython/first-steps/install-guide).***

## First Script (LED Blink)

Expand Down
4 changes: 2 additions & 2 deletions content/micropython/01.basics/00.digital-io/digital-io.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ In this guide, we will be using some additional electronic components:

## Board and Editor Setup

1. Open the [Arduino Lab for MicroPython]() application.
1. Open the [Arduino Lab for MicroPython](https://labs.arduino.cc/en/labs/micropython) application.
2. Plug the Arduino board into the computer using a USB cable.
![Connect board to computer.](assets/usb-comp.png)
3. Press the connection button on the top left corner of the window. The connected Arduino board should appear (by its port name), and we can click it:
![Connect to the board in the editor.](assets/select-board-ide.png)

***Need help installing MicroPython on your board? Visit the [MicroPython installation guide]().***
***Need help installing MicroPython on your board? Visit the [MicroPython installation guide](/micropython/first-steps/install-guide).***

## Digital Outputs

Expand Down
4 changes: 2 additions & 2 deletions content/micropython/01.basics/01.analog-io/analog-io.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ In this guide, we will be using some additional electronic components:

## Board and Editor Setup

1. Open the [Arduino Lab for MicroPython]() application.
1. Open the [Arduino Lab for MicroPython](https://labs.arduino.cc/en/labs/micropython) application.
2. Plug the Arduino board into the computer using a USB cable.
![Connect board to computer.](assets/usb-comp.png)
3. Press the connection button on the top left corner of the window. The connected Arduino board should appear (by its port name), and we can click it:
![Connect to the board in the editor.](assets/select-board-ide.png)

***Need help installing MicroPython on your board? Visit the [MicroPython installation guide]().***
***Need help installing MicroPython on your board? Visit the [MicroPython installation guide](/micropython/first-steps/install-guide).***

## Analog Inputs

Expand Down
4 changes: 2 additions & 2 deletions content/micropython/01.basics/02.loops/loops.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ MicroPython is officially supported on several Arduino boards. Here’s a list o

## Board and Editor Setup

1. Open the [Arduino Lab for MicroPython]() application.
1. Open the [Arduino Lab for MicroPython](https://labs.arduino.cc/en/labs/micropython) application.
2. Plug the Arduino board into the computer using a USB cable.
![Connect board to computer.](assets/usb-comp.png)
3. Press the connection button on the top left corner of the window. The connected Arduino board should appear (by its port name), and we can click it:
![Connect to the board in the editor.](assets/select-board-ide.png)

***Need help installing MicroPython on your board? Visit the [MicroPython installation guide]().***
***Need help installing MicroPython on your board? Visit the [MicroPython installation guide](/micropython/first-steps/install-guide).***

## Loop Structures in MicroPython

Expand Down
6 changes: 3 additions & 3 deletions content/micropython/01.basics/03.data-logger/data-logger.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Data logging using MicroPython is a great feature, as we can use the board's fil

In this tutorial, we will create a `.csv` file, make some readings from an analog pin, and store the data in the file. The file can then be accessed via the Arduino Lab for MicroPython editor.

***To learn more about the MicroPython file system, visit [this article]().***
***To learn more about the MicroPython file system, visit [this article](/micropython/environment/file-system).***

## Requirements

Expand Down Expand Up @@ -43,13 +43,13 @@ MicroPython is officially supported on several Arduino boards. Here’s a list o

## Board and Editor Setup

1. Open the [Arduino Lab for MicroPython]() application.
1. Open the [Arduino Lab for MicroPython](https://labs.arduino.cc/en/labs/micropython) application.
2. Plug the Arduino board into the computer using a USB cable.
![Connect board to computer.](assets/usb-comp.png)
3. Press the connection button on the top left corner of the window. The connected Arduino board should appear (by its port name), and we can click it:
![Connect to the board in the editor.](assets/select-board-ide.png)

***Need help installing MicroPython on your board? Visit the [MicroPython installation guide]().***
***Need help installing MicroPython on your board? Visit the [MicroPython installation guide](/micropython/first-steps/install-guide).***

## Data Logger Example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ description: 'The Arduino Lab for MicroPython is an online code editor for writi
author: 'Karl Söderby'
---

The [Arduino Lab for MicroPython](https://lab-micropython.arduino.cc/) is an online code editor that allows you to load MicroPython scripts to your Arduino board. This editor is part of the [Arduino Cloud](), and is free to use for everyone.
The [Arduino Lab for MicroPython](https://lab-micropython.arduino.cc/) is an online code editor that allows you to load MicroPython scripts to your Arduino board. This editor is part of the [Arduino Cloud](https://app.arduino.cc/), and is free to use for everyone.

In this tutorial, we will take a look at how we can access it, and test it out by writing a simple script.

***Note that this tutorial does not go in depth on how the Arduino Lab for MicroPython works. For more details, you can visit the [guide to the Arduino Lab for MicroPython]().***
***Note that this tutorial does not go in depth on how the Arduino Lab for MicroPython works. For more details, you can visit the [guide to the Arduino Lab for MicroPython](/micropython/environment/code-editor).***

## Requirements

- **Google Chrome, Opera, Edge** - these are the currently supported browsers.
- [Arduino Cloud account registered]()
- [A MicroPython compatible board]()
- [Arduino Cloud account registered](https://login.arduino.cc/login)
- [A MicroPython compatible board](/micropython/first-steps/install-guide/#micropython-compatible-arduino-boards)

## Setting Up

***To follow these steps, you will need to have MicroPython installed on your board. Haven't done this yet? Don't worry, check out the [Installing MicroPython]() guide.***
***To follow these steps, you will need to have MicroPython installed on your board. Haven't done this yet? Don't worry, check out the [Installing MicroPython](/micropython/environment/code-editor) guide.***

Setting up the online environment is quick and easy. Follow the steps below to achieve it:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ Arduino Lab for MicroPython includes a user-friendly code editor that helps us w

## Requirements

- [Arduino Lab for MicroPython]()
- [Arduino Lab for MicroPython](https://labs.arduino.cc/en/labs/micropython)
- **MicroPython compatible board** (not required for using the editor, but for running any code).

***Note that the Arduino Lab for MicroPython is now also available online, as part of the Arduino Cloud platform. You will find it here: [Arduino Cloud - Arduino Lab for MicroPython]().***
***Note that the Arduino Lab for MicroPython is now also available online, as part of the Arduino Cloud platform. You will find it here: [Arduino Cloud - Arduino Lab for MicroPython](/micropython/environment/code-editor).***

## Arduino Labs for MicroPython

Expand Down Expand Up @@ -47,14 +47,14 @@ Managing files in the Arduino Lab for MicroPython is straightforward and allows

![Managing files in Arduino Lab for MicroPython](assets/IDEFileManager.png)

***For a detailed tutorial on using the file system, please refer to the [File System Tutorial]().***
***For a detailed tutorial on using the file system, please refer to the [File System Tutorial](/micropython/environment/file-system).***

### REPL

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.

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

## Code Editor

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ This runs from main.py # executed from main.py
This runs from my_new_script #executed from my_new_script
```

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

![Import code from a script.](assets/ImportScript.png)

Expand Down
4 changes: 2 additions & 2 deletions content/micropython/02.environment/03.modules/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ In this example, `time.sleep()` introduces a delay. Built-in modules like `time`

## External Modules

Some modules aren’t included with the default MicroPython installation and need to be installed separately. External modules, often provided by the community or specific hardware packages, extend MicroPython’s functionality. For example, the [Modulino library]() is an external module that provides tools for working with Arduino Modulinos.
Some modules aren’t included with the default MicroPython installation and need to be installed separately. External modules, often provided by the community or specific hardware packages, extend MicroPython’s functionality. For example, the [Modulino library](https://github.com/arduino/arduino-modulino-mpy) is an external module that provides tools for working with Arduino Modulinos.

To demonstrate how to use external modules, we’ll go through the steps to install the Modulino package on an Arduino board.

Expand All @@ -51,7 +51,7 @@ Before we can install external modules, we need to have MicroPython running on o
- Press the "Refresh" button if the board does not appear.
- Click "**Install MicroPython**" and wait for the installation to complete.

***For more details, visit the [MicroPython installation guide]()***
***For more details, visit the [MicroPython installation guide](/micropython/first-steps/install-guide)***

### Step 2: Install the Modulino Package

Expand Down
4 changes: 0 additions & 4 deletions content/micropython/02.environment/05.repl/repl.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ When writing `name` in the REPL, (after `name = "Pedro"`), we should get:
'Pedro'
```

![TODO: GIF showing step by step so people understand to run each individually]()

## Example: Perform a Calculation in the REPL

Now let's create a REPL session that performs a calculation, by adding two numbers together:
Expand All @@ -59,8 +57,6 @@ Now let's create a REPL session that performs a calculation, by adding two numbe
8
```

![TODO: GIF showing step by step so people understand to run each individually]()

In this REPL session, we:

- Defined variables by setting `a` to `5` and `b` to `3`.
Expand Down
2 changes: 1 addition & 1 deletion content/micropython/03.language/01.reference/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@ print("Hello World!")

`while True:`

A loop is not required in a MicroPython script, but is required in order to run a script continuously on the board. To have a loop in a program, we need to use a [while loop]().
A loop is not required in a MicroPython script, but is required in order to run a script continuously on the board. To have a loop in a program, we need to use a [while loop](/micropython/basics/loops/#while-loops).

**Example:**

Expand Down
32 changes: 7 additions & 25 deletions content/micropython/04.board-examples/giga-r1-wifi/giga-r1-wifi.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
title: GIGA R1 WiFi
description: Learn how to use specific features on the GIGA R1 WiFi using MicroPython
author: Pedro Sousa Lima
---

![GIGA R1 WiFi](./assets/giga-r1.png)

In this guide, you will find information specific to the [GIGA R1 WiFi board](https://store.arduino.cc/products/giga-r1-wifi), such as supported serial protocols, built-in peripherals, and how to access the wireless features.
Expand All @@ -26,16 +28,6 @@ The GIGA R1 WiFi has several board-specific features that we can access through
- **Wireless Connectivity**: Supports both **Wi-Fi®** and **Bluetooth®** using the integrated Murata 1DX module.
- **High-speed Connectivity**: Includes a USB-C® connector, high-speed UART, and CAN bus support.


## Wireless Connectivity

The GIGA R1 WiFi features a Murata 1DX module that provides both **Wi-Fi®** and **Bluetooth®** connectivity. To find examples, please visit the links below:

- **[MicroPython - Bluetooth® documentation]()**
- **[MicroPython - Wi-Fi® documentation]()**



## Dual-Core Programming

The GIGA R1 WiFi supports dual-core programming, where the Cortex-M7 and Cortex-M4 cores can execute separate tasks simultaneously. Below is an example of how to run MicroPython on one core while offloading specific tasks to the other:
Expand All @@ -60,9 +52,7 @@ def main_task():
main_task()
```

> **Note**: Dual-core programming is an advanced topic and requires proper synchronization to avoid resource conflicts.


**Note**: Dual-core programming is an advanced topic and requires proper synchronization to avoid resource conflicts.

## RGB LED

Expand Down Expand Up @@ -140,20 +130,21 @@ ch.pulse_width_percent(25) # 25% duty cycle

The **msgpackrpc** library provides the same functionality as the Arduino RPC library for MicroPython, allowing seamless communication between the two cores (M7 and M4) on the GIGA R1 WiFi. This library enables binding of local functions or objects, starting the M4 core, and invoking remote calls from Python scripts.

#### Key Features:
### Key Features:
- **Dual-Core Support**: Execute tasks on the M4 core while the main MicroPython code runs on the M7 core.
- **Ease of Use**: The library is built-in and enabled by default in compatible Arduino boards, starting with MicroPython release v1.23.
- **No External Dependencies**: The library is included in the MicroPython firmware and does not require additional installations.


#### Restrictions:
### Restrictions:

While powerful, the **msgpackrpc** library has some limitations:
1. Arduino sketches can only run on the **M4 core**.
2. **SDRAM-based firmware** is not supported.
3. **Flash-based firmware** must use a 1.5MB M7 + 0.5MB M4 flash partitioning scheme.


#### Example
### Example

Here’s how to bind a function on the M7 core and call it from the M4 core:

Expand Down Expand Up @@ -189,15 +180,6 @@ print(result) # Outputs: Hello from M7!

For a detailed explanation of the RPC library, including advanced use cases and configuration, visit the [RPC Library with MicroPython guide](https://docs.arduino.cc/tutorials/giga-r1-wifi/giga-dual-core/#using-the-rpc-library-with-micropython).


## Additional Features

The GIGA R1 WiFi includes other features that can be explored:

- **Analog Pins**: Use `ADC` to read analog values from sensors.
- **PWM**: Use `PWM` for pulse-width modulation to control motors or LEDs.


## Summary

The GIGA R1 WiFi is a robust microcontroller packed with advanced features for embedded programming with MicroPython. From dual-core programming to high-speed connectivity and wireless communication, this guide provides the essentials to get started with this powerful board.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ author: Karl Söderby

![Nano BLE Sense](assets/ble-sense.png)

In this guide, you will find information specific to the [Nano BLE Sense board](), such as supported serial protocols and built-in sensors that can be accessed.
In this guide, you will find information specific to the [Nano BLE Sense board](https://store.arduino.cc/products/nano-33-ble-sense-rev2), such as supported serial protocols and built-in sensors that can be accessed.

For installation instructions, please visit the link below.
- [Installing MicroPython]()
- [Installing MicroPython](/micropython/first-steps/install-guide)

## Pinout

The pinout for the Nano BLE Sense can be found in the image below.

![Nano BLE Sense Pinout](assets/ABX00031-pinout.png)

***For more details on this product, visit the [hardware product page](/hardware/nano-rp2040-connect/).***
***For more details on this product, visit the [hardware product page](/hardware/nano-33-ble-sense-rev2/).***

## Board Specific Features

Expand Down Expand Up @@ -297,7 +297,7 @@ devices = i2c.scan()
print("I2C devices found:", devices)
```

***Read more about I2C in [this article]().***
***Read more about I2C in [this article](/micropython/communication/i2c).***

### UART

Expand All @@ -315,7 +315,7 @@ data = uart.read()
print("Received:", data)
```

***Read more about SPI in [this article]().***
***Read more about SPI in [this article](/micropython/communication/spi).***

### SPI

Expand All @@ -336,4 +336,4 @@ spi = SPI(1, baudrate=1000000, polarity=0, phase=0, sck=Pin(18), mosi=Pin(23), m
print("SPI initialized")
```

***Read more about UART in [this article]().***
***Read more about UART in [this article](/micropython/communication/uart).***
Loading
Loading