diff --git a/content/hardware/03.nano/boards/nano-33-ble/tutorials/ble-python-api/ble-python-api.md b/content/hardware/03.nano/boards/nano-33-ble/tutorials/ble-python-api/ble-python-api.md index 75cae07001..c85d39cab9 100644 --- a/content/hardware/03.nano/boards/nano-33-ble/tutorials/ble-python-api/ble-python-api.md +++ b/content/hardware/03.nano/boards/nano-33-ble/tutorials/ble-python-api/ble-python-api.md @@ -11,7 +11,7 @@ featuredImage: 'board' ![The Nano 33 BLE](assets/hero.png) -The [Nano 33 BLE board](https://store.arduino.cc/arduino-nano-33-ble-sense) board can be programmed using the popular **Python** programming language. More specifically, it supports [OpenMV's fork of MicroPython](https://github.com/openmv/micropython), where MicroPython is an implementation of the Python language, designed to run on microcontrollers. In this article, you will find a lot of sample scripts that will work directly with your Nano 33 BLE, such as general GPIO control, reading data from the IMU module and testing Bluetooth® Low Energy connection. +The [Nano 33 BLE](https://store.arduino.cc/arduino-nano-33-ble-sense) board can be programmed using the popular **Python** programming language. More specifically, it supports [OpenMV's fork of MicroPython](https://github.com/openmv/micropython), where MicroPython is an implementation of the Python language, designed to run on microcontrollers. In this article, you will find a lot of sample scripts that will work directly with your Nano 33 BLE, such as general GPIO control, reading data from the IMU module and testing Bluetooth® Low Energy connection. - If you want to read more about Arduino & Python, you can visit the [Python with Arduino](/learn/programming/arduino-and-python) article. Here you will find a lot of useful examples, such as how to use delays, interrupts, reading pins and more general functions. diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/over-the-air-update/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/over-the-air-update/content.md index efa2f24f43..503455e7fa 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/over-the-air-update/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/over-the-air-update/content.md @@ -33,7 +33,7 @@ The goals of this tutorial are: - Use QSPI or SD card storage to load the firmware downloaded using the OTA feature. ## Hardware and Software Needed -- Arduino Portenta H7 (https://store.arduino.cc/portenta-h7) +- [Arduino Portenta H7](https://store.arduino.cc/portenta-h7) - Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ - USB-C type cable (either USB-A to USB-C or USB-C to USB-C) - Arduino IoT Cloud and Arduino_Portenta_OTA libraries @@ -94,7 +94,7 @@ void loop() } ``` -This script will light up the RGB LED with 3 different colors in sequence. This code will need to be uploaded to the Arduino Portenta H7 firsthand. This is to verify the sketch compiles and is working correctly. After verifying this, in Arduino IDE, you will search for Sketch -> Export Compiled Binary. +This script will light up the RGB LED with 3 different colors in sequence. This code will need to be uploaded to the Arduino Portenta H7 firsthand. This is to verify the sketch compiles and is working correctly. After verifying this, in Arduino IDE, you will search for **Sketch > Export Compiled Binary**. ![Exporting Binary for the Sketch](assets/binary_export.png) @@ -105,6 +105,7 @@ With the binary file created, we can now create the ota file needed to complete You will have to have to extract the library at a preferred location to be able to use the tools. Then you will need to run on the terminal following commands in sequence to be able to create the ota file. Copy the binary file into the library tool's folder + ```cpp // Mac/Linux cp OTA_Usage_Portenta.ino.PORTENTA_H7_M7.bin ~/Arduino/libraries/ArduinoIoTCloud/extras/tools/ @@ -114,6 +115,7 @@ copy OTA_Usage_Portenta.ino.PORTENTA_H7_M7.bin /Documents/Arduino/libr ``` Go inside that directory + ```cpp // Mac/Linux cd ~/Arduino/libraries/ArduinoIoTCloud/extras/tools @@ -123,6 +125,7 @@ cd /Documents/Arduino/libraries/ArduinoIoTCloud/extras/tools ``` Encode your binary file into `OTA_Usage_Portenta.ino.PORTENTA_H7_M7.lzss` + ```cpp // Mac/Linux ./lzss.py --encode OTA_Usage_Portenta.ino.PORTENTA_H7_M7.bin OTA_Usage_Portenta.ino.PORTENTA_H7_M7.lzss @@ -132,6 +135,7 @@ lzss.py --encode OTA_Usage_Portenta.ino.PORTENTA_H7_M7.bin OTA_Usage_Portenta.in ``` Convert your encoded file into `.ota` format + ```cpp // Mac/Linux ./bin2ota.py [PORTENTA_H7_M7] OTA_Usage_Portenta.ino.PORTENTA_H7_M7.lzss OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota @@ -142,7 +146,7 @@ bin2ota.py [PORTENTA_H7_M7] OTA_Usage_Portenta.ino.PORTENTA_H7_M7.lzss OTA_Usage We are using `OTA_Usage_Portenta.ino.PORTENTA_H7_M7` as a sketch name and for facilitated identification of the file. After this you will have the `.ota` file of the sketch that we would like to use with the OTA process. -***Now you have two options to choose, use QSPI, or use an SD Card to storage your OTA file. You can use the left side index to jump to the option that you may need*** +***Now you have two options to choose, use QSPI, or use an SD Card to storage your OTA file. You can use the left side index to jump to the option that you may need.*** ### QSPI Storage Mode @@ -152,9 +156,9 @@ To use internal **QSPI** storage for downloading the binary file via OTA (Over-T ![Arduino Portenta H7 Board Connection](assets/portenta_h7_board_selection.png) #### Writing the Script -To proceed with a OTA using the QSPI flash, you can open the sketch from **Examples ->Arduino_Portenta_OTA -> OTA_Qspi_Flash**. +To proceed with a OTA using the QSPI flash, you can open the sketch from **Examples >Arduino_Portenta_OTA > OTA_Qspi_Flash**. -***Do not forget to fill your Wi-Fi AP SSID, and password on the `arduino_secrets.h` tab*** +***Do not forget to fill your Wi-Fi AP SSID, and password on the `arduino_secrets.h` tab.*** This sketch will connect to your Wi-Fi, check if the OTA feature is available by checking the installed firmware on your Portenta. @@ -170,10 +174,9 @@ To use the **SD card** as the preferred OTA (Over-The-Air) storage device, we wi With this, you will need the Arduino Portenta H7 board connected to the computer with the Arduino IDE. You will need to have selected the **Arduino Portenta H7 (M7 Core)** with the Flash split of **1MB M7 + 1MB M4** for the purpose of this tutorial and the corresponding port. #### Writing the Script +As same as QSPI storage mode, to proceed with a OTA using the SD Card, you can open the sketch from **Examples > Arduino_Portenta_OTA > OTA_SD_Portenta**. -As same as QSPI storage mode, to proceed with a OTA using the SD Card, you can open the sketch from **Examples ->Arduino_Portenta_OTA -> OTA_SD_Portenta**. - -***Do not forget to fill your Wi-Fi AP SSID, and password on the `arduino_secrets.h` tab*** +***Do not forget to fill your Wi-Fi AP SSID, and password on the `arduino_secrets.h` tab.*** This sketch will connect to your Wi-Fi, check if the OTA feature is available by checking the installed firmware on your Portenta. @@ -394,7 +397,8 @@ void loop() } ``` -## Troubleshooting +## Troubleshooting For troubleshooting the issues that might have arose following the tutorial, you can use following tips to solve the issue. + - If it logs there has been an issue with Wi-Fi module, means the device may have suffered from losing the Wi-Fi firmware partition. To solve this, you will have to use **PortentaWiFiFirmwareupdater** sketch found on Arduino IDE examples to fix the issue. - QSPI storage may throw error -3 while running Portenta H7 OTA QSPI example. To fix this you can use this guide of [Reading and Writing Flash Memory](https://docs.arduino.cc/tutorials/portenta-h7/por-ard-flash/) in the section **Programming the QSPI Flash**. After this, run the example and it should have been solved by eliminating error -3 (OTA Storage initialization error). \ No newline at end of file diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-ap/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-ap/content.md index ea0c8dc58a..c0ad4235a9 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-ap/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-ap/content.md @@ -24,20 +24,22 @@ software: Portenta H7 comes with an on-board Wi-Fi and a Bluetooth® Module that allows to develop IoT applications that require wireless connectivity and Internet access. Turning the board into an access point allows it to create a Wi-Fi network on its own and allows other devices to connect to it. In this tutorial you will learn to set up your board as an access point web server and remotely control the red, green and blue LEDs on the built-in RGB LED by accessing an HTML page on your mobile device’s browser. ## Goals + - About the built-in Wi-Fi + Bluetooth® module. - How a client-server model works - How to create an HTTP communication channel between the board and an external device. ### Required Hardware and Software -- Portenta H7 (ABX00042) or Portenta H7 Lite Connected (ABX00046) board () -- One USB C cable (either USB A to USB C or USB C to USB C) -- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4 + -- A smart phone + +- [Portenta H7 (ABX00042)](https://store.arduino.cc/portenta-h7) or [Portenta H7 Lite Connected (ABX00046)](https://store.arduino.cc/products/portenta-h7-lite-connected) +- One USB C cable (either USB A to USB C or USB C to USB C) +- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4 + +- A smart phone ## Access Point Configuration -The Portenta H7 features a [Murata 1DX](https://wireless.murata.com/type-1dx.html), which is a high performance chipset which supports Wi-Fi 802.11b/g/n + Bluetooth® 5.1 BR/EDR/LE up to 65Mbps PHY data rate on Wi-Fi and 3Mbps PHY data rate on Bluetooth®. This module helps to configure the Portenta into three different modes of operation - an Access Point, a Station, or both. In this tutorial we will only focus on the access point configuration. +The Portenta H7 features a [Murata 1DX](https://wireless.murata.com/type-1dx.html), which is a high performance chipset which supports Wi-Fi 802.11b/g/n + Bluetooth® 5.1 BR/EDR/LE up to 65Mbps PHY data rate on Wi-Fi and 3Mbps PHY data rate on Bluetooth®. This module helps to configure the Portenta into three different modes of operation - an Access Point, a Station, or both. In this tutorial we will only focus on the access point configuration. -When the board is configured to operate as an access point, it can create its own wireless LAN ( WLAN ) network. In this mode, the board transmits and receives signals at 2.4 GHz allowing other electronic devices with Wi-Fi capabilities using the same bandwidth to connect to the board. +When the board is configured to operate as an access point, it can create its own wireless LAN (WLAN) network. In this mode, the board transmits and receives signals at 2.4 GHz allowing other electronic devices with Wi-Fi capabilities using the same bandwidth to connect to the board. With the access point set up you create a client server architecture where the board provides a web server communicating with the client devices over HTTP. The connected devices can then make HTTP GET requests to the server to retrieve web pages served by the web server on the board. This makes the Portenta H7 an ideal board for developing IoT solutions where external client devices can send and receive information while more complex processing tasks take place on the server. @@ -46,7 +48,7 @@ With the access point set up you create a client server architecture where the b ## Instructions ### Setting Up the Web Server -In this tutorial you are going to convert the board into an access point and use it to set up a web server which provides a HTML webpage. This page contains buttons to toggle the red, green and blue colour of the built-in LED. You will then connect your mobile device to this access point and access this web page through the browser on your mobile phone. Once retrieved, you will be able to control the state of the red, green and blue LED on the built-in RGB LED from your mobile device. +In this tutorial you are going to convert the board into an access point and use it to set up a web server which provides a HTML webpage. This page contains buttons to toggle the red, green and blue color of the built-in LED. You will then connect your mobile device to this access point and access this web page through the browser on your mobile phone. Once retrieved, you will be able to control the state of the red, green and blue LED on the built-in RGB LED from your mobile device. ![A mobile device controlling the different LEDs on the board ](assets/por_ard_ap_tutorial_overview.svg) @@ -58,7 +60,7 @@ Begin by plugging in your Portenta board to your computer using a USB-C cable an ### 2. Create the Web Server Sketch Next we need to create a web server sketch that will handle the HTTP GET requests and provide the client devices with the HTML web page. The [Wi-Fi](https://www.arduino.cc/en/Reference/WiFi) library provides all necessary methods that allows Arduino boards to use their Wi-Fi features provided by the on-board Wi-Fi module. To set up the web server copy the following code, paste it into a new sketch file and name it **SimpleWebServer.ino**. -**Note:** You can access the final sketch inside the library: **Examples -> Arduino_Pro_Tutorials -> Portenta H7 as a Wi-Fi Access Point -> SimpleWebServer** +**Note:** You can access the final sketch inside the library: **Examples > Arduino_Pro_Tutorials > Portenta H7 as a Wi-Fi Access Point > SimpleWebServer** ```cpp #include @@ -255,7 +257,7 @@ Once you’ve created the new tab, you will see an empty page in the IDE. Define # define SECRET_PASS "123Qwerty" ``` -***The SSID (PortentaAccessPoint) and password (123Qwerty) are placeholder strings made for this tutorial. For security reasons you should rename them to something memorisable but not easy to guess. Keep in mind that the password must be at least 8 characters long.*** +***The SSID (PortentaAccessPoint) and password (123Qwerty) are placeholder strings made for this tutorial. For security reasons you should rename them to something memorable but not easy to guess. Keep in mind that the password must be at least 8 characters long.*** In order to access the `SECRET_SSID` and `SECRET_PASS` constants in the **simpleWebServer.ino** sketch file, the header file that you’ve just created needs to be included. In your sketch file this has already been taken care of by the following line at the beginning of the sketch: diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-ble/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-ble/content.md index ff4726b23b..2bf2e50b71 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-ble/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-ble/content.md @@ -30,14 +30,14 @@ In this tutorial we will enable low energy Bluetooth® on the Portenta H7 to all ### Required Hardware and Software -- Portenta H7 (ABX00042) or Portenta H7 Lite Connected (ABX00046) board () -- USB C cable (either USB A to USB C or USB C to USB C) -- Arduino IDE 1.8.13+ or Arduino Pro IDE 0.0.4+ -- Mobile device, phone or tablet -- [nRFconnect](https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Connect-for-mobile) or equivalent tool downloaded on your mobile device: [nRF Connect for iOS](https://itunes.apple.com/us/app/nrf-connect/id1054362403?ls=1&mt=8) or [nRF Connect for android](https://play.google.com/store/apps/details?id=no.nordicsemi.android.mcp) +- [Portenta H7 (ABX00042)](https://store.arduino.cc/portenta-h7) or [Portenta H7 Lite Connected (ABX00046)](https://store.arduino.cc/products/portenta-h7-lite-connected) +- USB C cable (either USB A to USB C or USB C to USB C) +- Arduino IDE 1.8.13+ or Arduino Pro IDE 0.0.4+ +- Mobile device, phone or tablet +- [nRFconnect](https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Connect-for-mobile) or equivalent tool downloaded on your mobile device: [nRF Connect for iOS](https://itunes.apple.com/us/app/nrf-connect/id1054362403?ls=1&mt=8) or [nRF Connect for android](https://play.google.com/store/apps/details?id=no.nordicsemi.android.mcp) ## Portenta and Low Energy Bluetooth® -The onboard WiFi/Bluetooth® module of the H7 offers low energy Bluetooth® functionality that gives the board the flexibility to be easily connected to devices which also support Bluetooth® Low Energy such as the Arduino Nano 33 IoT or most modern smart phones. Compared to classic Bluetooth®, Low Energy Bluetooth® is intended to provide considerably reduced power consumption and cost while maintaining a similar communication range. +The onboard Wi-Fi/Bluetooth® module of the H7 offers low energy Bluetooth® functionality that gives the board the flexibility to be easily connected to devices which also support Bluetooth® Low Energy such as the Arduino Nano 33 IoT or most modern smart phones. Compared to classic Bluetooth®, Low Energy Bluetooth® is intended to provide considerably reduced power consumption and cost while maintaining a similar communication range. ## Instructions @@ -54,7 +54,7 @@ Begin by plugging in your Portenta board to the computer using a USB-C cable and ### 2. Install the ArduinoBLE Library -You will need to install the ArduinoBLE library in the Arduino IDE you are using. For this example we will use the classic Arduino IDE. To install the library go to : **Tools -> Manage Libararies...** type **ArduinoBLE** and click **Install**. Make sure you install ArduinoBLE version 1.1.3 or higher. +You will need to install the ArduinoBLE library in the Arduino IDE you are using. For this example we will use the classic Arduino IDE. To install the library go to : **Tools > Manage Libraries...** type **ArduinoBLE** and click **Install**. Make sure you install ArduinoBLE version 1.1.3 or higher. ![Download the Bluetooth® Low Energy library in the Library Manager.](assets/por_ard_ble_arduino_library.png) @@ -62,7 +62,7 @@ You will need to install the ArduinoBLE library in the Arduino IDE you are using ### 3. Create the Bluetooth® Low Energy Sketch -Let's program the Portenta with the following example sketch. If the Bluetooth® Low Energy module can be initialized correctly, you will see the blue LED lighting up for one second after uploading the sketch. If it fails you will see the red LED lighting up instead. Copy and paste the following code into a new sketch in your IDE or by open it from: **Examples -> Arduino_Pro_Examples -> BLE Connectivity on Portenta H7 -> PortentaBLE** +Let's program the Portenta with the following example sketch. If the Bluetooth® Low Energy module can be initialized correctly, you will see the blue LED lighting up for one second after uploading the sketch. If it fails you will see the red LED lighting up instead. Copy and paste the following code into a new sketch in your IDE or by open it from: **Examples > Arduino_Pro_Examples > BLE Connectivity on Portenta H7 > PortentaBLE** ```cpp #include @@ -157,6 +157,7 @@ void loop() { ``` In our example we use a pre-defined Bluetooth® number code pre-setup for controlling a device's LEDs. This code can also be referred to as [GATT codes](https://www.bluetooth.com/specifications/gatt/services/), which define how two Bluetooth® low energy devices transfer data. Once a connection is established with a device, its respective GATT code, which is a 16 bit identifier, is stored in a lookup table for future reference. + These GATT codes are very long, but in our example it is always the same code: ```BLEService ledService("19b10000-e8f2-537e-4f6c-d104768a1214"); // BLE LED Service``` @@ -165,8 +166,9 @@ These GATT codes are very long, but in our example it is always the same code: ### 4. Upload the Sketch -Double press the reset button so the built-in LED is slowly pulsing green. Then, select your board in the menu: **Tools** -> **Board** -> **Arduino Portenta H7 (M7 core)** - ![Select the Arduino Portenta H7 (M7 core) in the board selector.](assets/por_ard_ble_select_board_h7.png) +Double press the reset button so the built-in LED is slowly pulsing green. Then, select your board in the menu: **Tools > Board > Arduino Portenta H7 (M7 core)** + +![Select the Arduino Portenta H7 (M7 core) in the board selector.](assets/por_ard_ble_select_board_h7.png) Then choose the **Port** where your Portenta is connected to and **Upload** the sketch. Open the Serial Monitor once you've **uploaded** the code to the board to see debugging messages. If the Bluetooth® Low Energy setup was successful you should see the message `BLE LED Control ready`. If something went wrong you will see the message `Starting Bluetooth® Low Energy failed!` In that case update the Arduino BLE library (in the Library Manager) and the board (in the Board Manager) to the latest version and try again. @@ -191,9 +193,10 @@ This tutorial shows how to connect and control the built-in LED using a Bluetoot ### Next Steps -Now that you learnt how to configure the Portenta as a Bluetooth® Low Energy endpoint you can try with two Portentas (or other Bluetooth® Low Energy capable Arduino devices) to facilitate bidirectional communication. More information on how to achieve that can be found on the [BLE library reference page](https://www.arduino.cc/en/Reference/ArduinoBLE) +Now that you learnt how to configure the Portenta as a Bluetooth® Low Energy endpoint you can try with two Portentas (or other Bluetooth® Low Energy capable Arduino devices) to facilitate bidirectional communication. More information on how to achieve that can be found on the [BLE library reference page](https://www.arduino.cc/en/Reference/ArduinoBLE). ## Troubleshooting + ### Sketch Upload Troubleshooting If you try to upload a sketch and receive an error message, saying that the upload has failed you can try to upload the sketch while the Portenta H7 is in bootloader mode. To do so you need to double click the reset button. The green LED will start fading in and out. Try to upload the sketch again. The green LED will stop fading when the upload completes. diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-dcp/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-dcp/content.md index c6c6d08b28..8690e1bbf3 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-dcp/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-dcp/content.md @@ -20,18 +20,20 @@ software: --- ## Overview -The Portenta H7 is equipped with a processor that has two processing units called cores. Dual core processing is the ability of a processor to read and execute instructions in two different cores simultaneously. In other words, a dual core processor can execute two applications, in this case two Arduino sketches, at the same time. In this tutorial you will run two classic Arduino blink programs simultaneously on different cores of the Portenta board that blinks the RGB LED in two different colours. +The Portenta H7 is equipped with a processor that has two processing units called cores. Dual core processing is the ability of a processor to read and execute instructions in two different cores simultaneously. In other words, a dual core processor can execute two applications, in this case two Arduino sketches, at the same time. In this tutorial you will run two classic Arduino blink programs simultaneously on different cores of the Portenta board that blinks the RGB LED in two different colors. ## Goals -- How to upload and run applications on Portenta's M7 and M4 cores. -- About the characteristics of the M7 and the M4 cores. -- How to force boot the M4 core through the M7 core and why that is necessary. -- Controlling the colours of the built-in RGB LED.  + +- How to upload and run applications on Portenta's M7 and M4 cores. +- About the characteristics of the M7 and the M4 cores. +- How to force boot the M4 core through the M7 core and why that is necessary. +- Controlling the colors of the built-in RGB LED.  ### Required Hardware and Software -- Portenta H7 (ABX00042), Portenta H7 Lite Connected (ABX00046) or Portenta H7 Lite (ABX00045) board () -- USB C cable (either USB A to USB C or USB C to USB C) -- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+  + +- [Portenta H7 (ABX00042)](https://store.arduino.cc/portenta-h7) or [Portenta H7 Lite Connected (ABX00046)](https://store.arduino.cc/products/portenta-h7-lite-connected) +- USB C cable (either USB A to USB C or USB C to USB C) +- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+  ## Cortex® M7 & M4 Processor cores are individual processing units within the board's main processing unit (don't confuse a processor core with an [Arduino core](https://www.arduino.cc/en/guide/cores)). These cores are responsible for the executing instructions at a particular clock speed.  The on-board  Arm Cortex processor comes with two cores (Cortex® M7 and M4), with slightly different architectures and clock speeds. The M7  runs at 480 MHz and the architecture is designed  to separate Instruction and Data buses to optimize CPU latency. The M4 runs at 240 MHz and the architecture supports the ART™ accelerator (a block that speeds up instruction fetching accesses of the Cortex-M4 core to the D1-domain internal memories). The higher clock rate of the M7 makes it suitable to handle complex processing tasks such as data storage, debugging or handling input/output peripherals at a higher efficiency compared to the M4. The dual core processor of the Portenta H7 sets it apart from other single core Arduino boards by allowing true multitasking, faster data processing capabilities, enhanced processing power and application partitioning.   @@ -41,7 +43,7 @@ Processor cores are individual processing units within the board's main processi ## Instructions ### Accessing the M7 and M4 Core -To best illustrate the idea of dual core processing, you will be running two separate sketch files. One on each of the cores which blinks the RGB LED in a different colour. The **BlinkRedLed_M7.ino** sketch will set the built-in RGB LED on the board to red and blink it with a delay of 500 ms. The **BlinkGreenLed_M4.ino** sketch will access the green LED in the RGB led and blink it with a delay of 200 ms. Both the cores will be executing the corresponding sketch file simultaneously and as a result both the green and red LED blink, however, at different intervals. +To best illustrate the idea of dual core processing, you will be running two separate sketch files. One on each of the cores which blinks the RGB LED in a different color. The **BlinkRedLed_M7.ino** sketch will set the built-in RGB LED on the board to red and blink it with a delay of 500 ms. The **BlinkGreenLed_M4.ino** sketch will access the green LED in the RGB led and blink it with a delay of 200 ms. Both the cores will be executing the corresponding sketch file simultaneously and as a result both the green and red LED blink, however, at different intervals. ![Running two different sketch files on the different cores.](assets/por_ard_dcp_tutorial_overview.svg) @@ -50,10 +52,10 @@ Begin by plugging-in your Portenta board to your computer using an appropriate U ![A Basic setup of the board attached to your computer](../por-ard-gs/assets/por_ard_gs_basic_setup.svg) -**Note:** You can access the examples from the tutorials library once it's installed: **Examples -> Arduino_Pro_Tutorials -> Dual Core Processing** +**Note:** You can access the examples from the tutorials library once it's installed: **Examples > Arduino_Pro_Tutorials > Dual Core Processing** ### 2. Setting the LED Color -In the previous tutorial you learned how to access the built-in RGB LED through the macro definition LED_BUILTIN. You can also control the distinct Red, Green and Blue LED separately through the LEDR, LEDG and LEDB macro definition respectively.  +In the previous tutorial you learned how to access the built-in RGB LED through the macro definition LED_BUILTIN. You can also control the distinct Red, Green and Blue LED separately through the LEDR, LEDG and LEDB macro definition respectively.  Please note that, opposed to other Arduino boards, on the Portenta H7 the built-in RGB led pins need to be pulled to ground to make the LED light up. This means that a voltage level of LOW will turn the LED on, a voltage level of HIGH will turn it off. @@ -167,7 +169,7 @@ Then, as well inside the `setup()` function, you will need to include the follow ``` ### 3. Finishing the Setup() Function and Programming the Loop() -To finish with the `setup()` you will need to initialise the LEDs as outputs. +To finish with the `setup()` you will need to initialize the LEDs as outputs. Then in the `loop()` function you will need to include the sequence that blink the LEDs. to do so, add the following portion of code right after the `#endif`. @@ -189,4 +191,5 @@ Now can upload the sketch to both the cores of the Portenta H7 individually. Wit This tutorial introduces the idea of dual core processing and illustrates the concept by using the M7 and M4 cores to control the different colors of the built-in RGB LED. This simple example only describes how to access the M7 and M4 cores. In the upcoming tutorials you will learn to create applications that leverage the potential of dual core processing to perform more complex tasks.  ### Next Steps -- Proceed with the next tutorial "Setting Up a Wi-Fi Access Point" to learn how to make use of the built-in Wi-Fi module and configure your Portena H7 as a Wi-Fi access point. + +- Proceed with the next tutorial "Setting Up a Wi-Fi Access Point" to learn how to make use of the built-in Wi-Fi module and configure your Portenta H7 as a Wi-Fi access point. diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-flash/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-flash/content.md index 54fa09945c..cdf46e8c9e 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-flash/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-flash/content.md @@ -22,12 +22,14 @@ software: This tutorial demonstrates how to use the on-board Flash memory of the Portenta H7 to read and write data using the BlockDevice API provided by Mbed OS. As the internal memory is limited in size we will also take a look at saving data to the QSPI Flash memory. ## Goals + - Accessing the Portenta's internal Flash memory using Mbed's Flash In-Application Programming Interface - Accessing the Portenta's QSPI Flash memory using Mbed's Flash In-Application Programming Interface - Reading the memory's characteristics ### Required Hardware and Software -- Portenta H7 (ABX00042), Portenta H7 Lite Connected (ABX00046) or Portenta H7 Lite (ABX00045) board () + +- [Portenta H7 (ABX00042)](https://store.arduino.cc/portenta-h7) or [Portenta H7 Lite Connected (ABX00046)](https://store.arduino.cc/products/portenta-h7-lite-connected) - USB-C cable (either USB-A to USB-C or USB-C to USB-C) - Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ or Arduino CLI 0.13.0+ @@ -79,6 +81,7 @@ struct FlashIAPLimits { ``` The last part of the helper file consists of the `getFlashIAPLimits()` function used to calculate both the size of the Flash memory as well as the size and start address of the available memory. + This is done with Mbed's [FlashIAP](https://os.mbed.com/docs/mbed-os/v6.6/mbed-os-api-doxy/classmbed_1_1_flash_i_a_p.html) API. It finds the address of the first sector after the sketch stored in the microcontroller's ROM: `FLASHIAP_APP_ROM_END_ADDR` and uses the FlashIAP to calculate the Flash memory's size with `flash.get_flash_size()`. The other parameters can be determined using the same API. ```cpp @@ -381,6 +384,7 @@ if(blockDevice.init() != 0 || blockDevice.size() != BLOCK_DEVICE_SIZE) { ``` While the QSPI block device memory can be used directly, it's better to use a partition table as the QSPI storage is also filled with other data such as the Wi-Fi firmware. For that we use the [MBRBlockDevice](https://os.mbed.com/docs/mbed-os/v6.8/apis/mbrblockdevice.html) class and allocate a 8 KB partition which can then be used to read and write data. + The full QSPI version of the sketch is as follows: ```cpp diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-gs/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-gs/content.md index cffce2381d..7088893510 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-gs/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-gs/content.md @@ -29,19 +29,21 @@ At the moment of writing the tutorial, there is an Arduino core and a MicroPytho This tutorial focuses on the Arduino core which allows you to benefit from the thousands of existing Arduino libraries and code examples written in C and C++ which are compatible with the Arduino core. A tutorial about setting the Portenta H7 up for development with the MicroPython core will be released soon. ## Goals -- About the Arduino and Mbed operating system (Mbed OS) stack -- Installing the Mbed library -- Controlling the built in LED on the Portenta board + +- About the Arduino and Mbed operating system (Mbed OS) stack +- Installing the Mbed library +- Controlling the built in LED on the Portenta board ### Required Hardware and Software -- Portenta H7 (ABX00042), Portenta H7 Lite Connected (ABX00046) or Portenta H7 Lite (ABX00045) board () -- USB C cable (either USB A to USB C or USB C to USB C) -- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ + +- [Portenta H7 (ABX00042)](https://store.arduino.cc/products/portenta-h7), [Portenta H7 Lite (ABX00045)](https://store.arduino.cc/products/portenta-h7-lite) or [Portenta H7 Lite Connected (ABX00046)](https://store.arduino.cc/products/portenta-h7-lite-connected) +- USB C cable (either USB A to USB C or USB C to USB C) +- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ ## Portenta and The Arduino Core -The Portenta H7 is equipped with two Arm Cortex ST processors (Cortex-M4 and Cortex-M7) which run the Mbed OS. Mbed OS is an embedded real time operating system (RTOS) designed specifically for microcontrollers to run IoT applications on low power. A real-time operating system is an operating system designed to run real-time applications that process data as it comes in, typically without buffer delays. [Here](https://www.ni.com/en-us/innovations/white-papers/07/what-is-a-real-time-operating-system--rtos--.html) you can read more about real time operating systems. +The Portenta H7 is equipped with two Arm Cortex ST processors (Cortex-M4 and Cortex-M7) which run the Mbed OS. Mbed OS is an embedded real time operating system (RTOS) designed specifically for microcontrollers to run IoT applications on low power. A real-time operating system is an operating system designed to run real-time applications that process data as it comes in, typically without buffer delays. [Here you can read more about real time operating systems](https://www.ni.com/en-us/innovations/white-papers/07/what-is-a-real-time-operating-system--rtos--.html). -The Arduino core for the Portenta H7 sits on top of the Mbed OS and allows to develop applications using Mbed OS APIs which handle for example storage, connectivity, security and other hardware interfacing. [Here](https://os.mbed.com/docs/mbed-os/v5.15/apis/index.html) you can read more about the Mbed OS APIs. However, taking advantage of the Arm® Mbed™ real time operating system's powerful features can be a complicated process. Therefore we simplified that process by allowing you to run Arduino sketches on top of it. +The Arduino core for the Portenta H7 sits on top of the Mbed OS and allows to develop applications using Mbed OS APIs which handle for example storage, connectivity, security and other hardware interfacing. [Here you can read more about the Mbed OS APIs](https://os.mbed.com/docs/mbed-os/v5.15/apis/index.html). However, taking advantage of the Arm® Mbed™ real time operating system's powerful features can be a complicated process. Therefore we simplified that process by allowing you to run Arduino sketches on top of it. ![The Arduino core is built on top of the Mbed stack](assets/por_gs_mbed_stack.svg) @@ -69,8 +71,8 @@ This step is the same for both the classic IDE and the Pro IDE. Open the board m ### 3. Uploading the Classic Blink Sketch Let's program the Portenta with the classic blink example to check if the connection to the board works. There are two ways to do that: -- In the classic Arduino IDE open the blink example by clicking the menu entry File->Examples->01.Basics->Blink. You need to swap LOW and HIGH pin values as the built-in LED on Portenta is turned on by pulling it LOW. -- By downloading the 'Arduino_Pro_Tutorials' library and opening the pre-made sketch under File->Examples->Arduino_Pro_Tutorials->Setting Up Portenta H7 For Arduino->Blink +- In the classic Arduino IDE open the blink example by clicking the menu entry **File > Examples > 01.Basics > Blink**. You need to swap LOW and HIGH pin values as the built-in LED on Portenta is turned on by pulling it LOW. +- By downloading the 'Arduino_Pro_Tutorials' library and opening the pre-made sketch under **File > Examples > Arduino_Pro_Tutorials > Setting Up Portenta H7 For Arduino > Blink** - In the Arduino Pro IDE Copy and paste the following code into a new sketch in your IDE. ```cpp @@ -92,9 +94,9 @@ void loop() { ***Remember that the built-in RGB LEDs on the Portenta H7 need to be pulled to ground to make them light up. This means that a voltage level of __LOW__ on each of their pins will turn the specific color of the LED on, a voltage level of __HIGH__ will turn them off. Furthermore invoking __pinMode(LED_BUILTIN, OUTPUT)__ pulls the LED LOW which means it turns the LED on.*** -For Portenta H7 LED_BUILTIN represents the built-in RGB LED on the board in green color. +For Portenta H7 LED_BUILTIN represents the built-in RGB LED on the board in green color. -**Note:** The individual colours of the built-in RGB LED can be accessed and controlled separately. In the tutorial "Dual Core Processing" you will learn how to control the LED to light it in different colors +**Note:** The individual colors of the built-in RGB LED can be accessed and controlled separately. In the tutorial "Dual Core Processing" you will learn how to control the LED to light it in different colors ### 4. Upload the Blink Sketch Now it's time to upload the sketch and see if the LED will start to blink. Make sure you select Arduino Portenta H7 (M7 core) as the board and the port to which the Portenta H7 is connected. If the Portenta H7 doesn't show up in the list of ports, go back to step 5 and make sure that the drivers are installed correctly. Once selected click Upload. Once uploaded the built-in LED should start blinking with an interval of 1 second. @@ -105,7 +107,7 @@ Now it's time to upload the sketch and see if the LED will start to blink. Make ![Selecting the Arduino Portenta H7 (M7 core)](assets/por_gs_board_selection_pro_ide.png) -**Optional:** We collect all the sketches from the tutorials in a library which you can install from the Library Manager: **Tools -> Manage Libraries**. Search for 'Arduino_Pro_Tutorials' or download them from the [repository](https://github.com/arduino-libraries/Arduino_Pro_Tutorials/releases). +**Optional:** We collect all the sketches from the tutorials in a library which you can install from the Library Manager: **Tools > Manage Libraries**. Search for 'Arduino_Pro_Tutorials' or download them from the [repository](https://github.com/arduino-libraries/Arduino_Pro_Tutorials/releases). ## Conclusion You have now configured your Portenta board to run Arduino sketches. Along with that you gained an understanding of how the Arduino Core runs on top of Mbed OS. @@ -133,6 +135,7 @@ SUBSYSTEM=="usb", ATTRS{idVendor}=="2341", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="0525", MODE="0666" ``` + - Reboot your PC - You may use the following commands to create a new udev rule from scratch: `echo 'SUBSYSTEMS=="usb", ATTR{idVendor}=="2341", MODE:="0666"' > 20-portenta.rules` diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-kvs/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-kvs/content.md index ac6e14efae..55fb92e6b1 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-kvs/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-kvs/content.md @@ -23,12 +23,14 @@ software: This tutorial explains how to create a Flash-optimized key-value store using the Flash memory of the Portenta H7. It builds on top of the **Flash In-Application Programming** tutorial. ## Goals + In this tutorial you will learn how to use the Mbed OS [TDBStore API](https://os.mbed.com/docs/mbed-os/v6.9/apis/kvstore.html) to create a [Key value store](https://en.wikipedia.org/wiki/Key%E2%80%93value_database) in the free space of the microcontroller's internal Flash. ### Required Hardware and Software -- Portenta H7 (ABX00042), Portenta H7 Lite Connected (ABX00046) or Portenta H7 Lite (ABX00045) board () -- USB C cable (either USB A to USB C or USB C to USB C) -- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ or Arduino CLI 0.13.0+ + +- [Portenta H7 (ABX00042)](https://store.arduino.cc/products/portenta-h7), [Portenta H7 Lite (ABX00045)](https://store.arduino.cc/products/portenta-h7-lite) or [Portenta H7 Lite Connected (ABX00046)](https://store.arduino.cc/products/portenta-h7-lite-connected) +- USB C cable (either USB A to USB C or USB C to USB C) +- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ or Arduino CLI 0.13.0+ ## Instructions @@ -46,11 +48,12 @@ Begin by plugging in your Portenta board to the computer using a USB-C cable and ### 2. Create the Structure of the Program Let's program the Portenta with a sketch. We will also define a few helper functions in a supporting header file. + * Create a new sketch named `FlashKeyValue.ino` * Create a new file named `FlashIAPLimits.h` to store the helper functions in a reusable file. **Note:** Finished sketch its inside the tutorials library wrapper at: -**Examples -> Arduino_Pro_Tutorials -> Creating a Flash-Optimized Key-Value Store -> FlashKeyValueStore** +**Examples > Arduino_Pro_Tutorials > Creating a Flash-Optimized Key-Value Store > FlashKeyValueStore** ### 3. Populate the Helper Functions First let's add the helper functions to the `FlashIAPLimits.h` header. This will determine the available Flash limits to allocate the custom data. @@ -301,9 +304,11 @@ Push the reset button to restart the sketch. The values of the stats have been u ## Conclusion We have learned how to use the available space in the Flash memory of the microcontroller to create a key-value store and use it to retrieve and store data. + It's not recommended to use the Flash of the microcontroller as the primary storage for data-intensive applications. It is best suited for read/write operations that are performed only once in a while such as storing and retrieving application configurations or persistent parameters. ### Next Steps + - Learn how to retrieve a collection of keys using TDBStore iterators via [`iterator_open`](https://os.mbed.com/docs/mbed-os/v6.9/mbed-os-api-doxy/classmbed_1_1_k_v_store.html#a77661adec54b9909816e7492a2c61a91) and [`iterator_next`](https://os.mbed.com/docs/mbed-os/v6.9/mbed-os-api-doxy/classmbed_1_1_k_v_store.html#a5116b40a3480462b88dc3f1bb8583ad4) - Learn how to create an incremental TDBStore set sequence via [`set_start`](https://os.mbed.com/docs/mbed-os/v6.9/mbed-os-api-doxy/classmbed_1_1_k_v_store.html#a6e882a0d4e0cbadf6269142ac3c4e693), [`set_add_data`](https://os.mbed.com/docs/mbed-os/v6.9/mbed-os-api-doxy/classmbed_1_1_k_v_store.html#adbe636bf8c05834fe68b281fc638c348) and [`set_finalize`](https://os.mbed.com/docs/mbed-os/v6.9/mbed-os-api-doxy/classmbed_1_1_k_v_store.html#a346da66252added46d3b93902066b548) - Learn how to use the 16MB QSPI Flash on the Portenta H7 diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-lvgl/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-lvgl/content.md index 9e8d847bb5..f185bc15f5 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-lvgl/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-lvgl/content.md @@ -26,12 +26,14 @@ software: In this tutorial you will learn to use [LVGL](https://lvgl.io/) to create a simple graphical user interface that consists of a text label that updates itself. ## Goals + - Understanding the structure to build LVGL interfaces. - Building a simple UI with a text label. - Configuring the setup to display the User-Interface. ### Required Hardware and Software -- Portenta H7 (ABX00042) board () + +- [Portenta H7 (ABX00042)](https://store.arduino.cc/products/portenta-h7) - USB-C cable (either USB-A to USB-C or USB-C to USB-C) - Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ - USB-C hub with HDMI @@ -40,7 +42,7 @@ In this tutorial you will learn to use [LVGL](https://lvgl.io/) to create a simp ## The Light and Versatile Graphics Library -Graphical User interfaces are necessary for visualising information and interacting with certain aspects of an application. The Light and Versatile Graphics Library, also known as [LVGL](https://lvgl.io/), is an open-sourced library used to create graphical user-interfaces for microcontrollers and high-end processors. The light weight embedded library provides all the necessary widgets and user interface elements that will allow you to easily create user interfaces for displays and touch screens. +Graphical User interfaces are necessary for visualizing information and interacting with certain aspects of an application. The Light and Versatile Graphics Library, also known as [LVGL](https://lvgl.io/), is an open-sourced library used to create graphical user-interfaces for microcontrollers and high-end processors. The light weight embedded library provides all the necessary widgets and user interface elements that will allow you to easily create user interfaces for displays and touch screens. ## Instructions @@ -58,11 +60,11 @@ Begin by plugging your Portenta board into the computer using a USB-C cable and ### 2. Download the LVGL Library -Next, select 'Portenta' in the **Tools -> Board** menu before installing [lvgl](https://github.com/lvgl/lvgl) from the Library Manager. Then go to **Sketch** **->** **Include Libraries** **-> Manage Libraries** and search for LVGL. Download **lvgl ** by [kisvegabor](https://github.com/kisvegabor). +Next, select 'Portenta' in the **Tools > Board** menu before installing [lvgl](https://github.com/lvgl/lvgl) from the Library Manager. Then go to **Sketch > Include Libraries > Manage Libraries** and search for LVGL. Download **lvgl** by [kisvegabor](https://github.com/kisvegabor). ![Library Manager showing the installed lvgl library.](assets/por_ard_lvgl_select_library.png) -***The sketches that we show are using the version 7.11.0, if you have the version 8 or greater you will need to make changes on the code, check LVGL API docs to see the update changes *** +***The sketches that we show are using the version 7.11.0, if you have the version 8 or greater you will need to make changes on the code, check LVGL API docs to see the update changes: .*** ### 3. Adding a Label Widget @@ -104,11 +106,11 @@ This sketch creates a label that will be displayed in the center of the connecte Compile and upload the sketch to your Portenta H7. At this point your board becomes the host. Unplug the board from your computer and connect it to the USB-hub along with a monitor that is connected to the HDMI port. Power up your hub by connecting it to an external power source and the monitor will display a label saying `Counter`. - ![Connecting the USB peripherals and the display to Portenta.](assets/por_ard_lvgl_connect_monitor.svg) +![Connecting the USB peripherals and the display to Portenta.](assets/por_ard_lvgl_connect_monitor.svg) - ***If you aren't familiar how the USB host works, we recommend you to have a look at the [USB Host tutorial](https://docs.arduino.cc/tutorials/portenta-h7/por-ard-usb)*** +***If you aren't familiar how the USB host works, we recommend you to have a look at the [USB Host tutorial](https://docs.arduino.cc/tutorials/portenta-h7/por-ard-usb).*** -Our label object currently has LVGL's default style. If you want to customise the style you can have a look at LVGL's [documentation](https://docs.lvgl.io/latest/en/html/widgets/label.html). +Our label object currently has LVGL's default style. If you want to customize the style you can have a look at LVGL's [documentation](https://docs.lvgl.io/latest/en/html/widgets/label.html). ### 5. Creating a Simple Counter @@ -208,12 +210,15 @@ This tutorial shows how to build a simple user interface with your Portenta. Sta Now that you know how to build a simple UI for a screen, you can try to add more labels to the screen to show various information or try out different LVGL widgets. ## Troubleshooting + ### Counter Label Doesn't Update + - Make sure that the label and task are declared on top of the sketch, outside the `setup()` and `loop()` like a normal variable. - Check if the task has the same structure in the first declaration and the function creation. - Look inside the `loop()` and see if `lv_task_handler()` is there. ### Sketch Upload Troubleshooting + - If you have troubles uploading the sketch, try to first set the board in bootloader mode, by clicking the reset button twice, then you should see the built-in LED pulsating. - If you uploaded the sketch and you don't have any output in the display, make sure you have `portenta_init_video()` in the `setup()`. - Unplug and plug the HDMI cable in again. diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-trace32/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-trace32/content.md index ed3b4c622c..9bf14f2760 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-trace32/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-trace32/content.md @@ -16,15 +16,16 @@ software: - web-editor --- ## Overview -This tutorial will show you how to use the Lauterbach TRACE32 GDB front-end debugger to debug your Portenta H7 application via GDB on a serial interface. It also explains how to obtain a free licence of a fully functional version of TRACE32 using your Portenta's serial number. +This tutorial will show you how to use the Lauterbach TRACE32 GDB front-end debugger to debug your Portenta H7 application via GDB on a serial interface. It also explains how to obtain a free license of a fully functional version of TRACE32 using your Portenta's serial number. ## Goals -- How to get a free license key for TRACE32 GDB Front End debugger for Portenta H7 - M7 core -- How to download and start the Lauterbach TRACE32 GDB Front End debugger -- How to Flash and debug some ready-to-run demos + +- How to get a free license key for TRACE32 GDB Front End debugger for Portenta H7 - M7 core +- How to download and start the Lauterbach TRACE32 GDB Front End debugger +- How to Flash and debug some ready-to-run demos ### Required Hardware and Software -- Portenta H7 (ABX00042), Portenta H7 Lite Connected (ABX00046) or Portenta H7 Lite (ABX00045) board () +- [Portenta H7 (ABX00042)](https://store.arduino.cc/products/portenta-h7), [Portenta H7 Lite (ABX00045)](https://store.arduino.cc/products/portenta-h7-lite) or [Portenta H7 Lite Connected (ABX00046)](https://store.arduino.cc/products/portenta-h7-lite-connected) - USB C cable (either USB A to USB C or USB C to USB C) - Arduino IDE 1.8.13+ or Arduino Pro IDE 0.1.0+ - Lauterbach TRACE32 (https://www.lauterbach.com/download_demo.html) @@ -65,7 +66,7 @@ There are two alternative ways to detect the board serial number: ![Click the menu item "Detect Board S/N" to display the serial number](assets/por_ard_trace32_board_sn.png) -![Licence State Dialog](assets/por_ard_trace32_license_state.png) +![License State Dialog](assets/por_ard_trace32_license_state.png) Either copy & paste the displayed serial number manually to the Lauterbach registration page or click on the provided link in the dialog window. @@ -98,7 +99,7 @@ For easy access, we suggest creating a link to the corresponding executable file On Windows systems, the TRACE32 start-up script will automatically search for the right COM port attached to the Portenta H7 board. -On Linux systems, you will need to edit the system-settings.cmm file to manually add the serial port to connect to the Portenta H7 board. This is a text file and can be opened with your favourite text editor. Edit the line that defines &GDBPORT to refer to the serial port, for example: `&GDBPORT="/dev/ttyACM0"`. This must be done **before** you start the TRACE32 software. After changing the port you can start the TRACE32 debugger or re-start it in case it was open while you made the changes. +On Linux systems, you will need to edit the system-settings.cmm file to manually add the serial port to connect to the Portenta H7 board. This is a text file and can be opened with your favorite text editor. Edit the line that defines &GDBPORT to refer to the serial port, for example: `&GDBPORT="/dev/ttyACM0"`. This must be done **before** you start the TRACE32 software. After changing the port you can start the TRACE32 debugger or re-start it in case it was open while you made the changes. ***The manual port setting is also useful for Windows systems where you have multiple Portenta H7 boards connected, and you want to select a specific board to be used by TRACE32 for debugging. The automatic port selection is disabled when a &GDBPORT definition is found in `system-settings.cmm`.*** @@ -118,7 +119,7 @@ Select "T32ThreadDebug" from the "Portenta H7 Demos" menu and you will be presen In this dialog you can select which variant of the Arduino IDE you would like to use to source ELF files or if you want to use the current directory. To follow this tutorial please select "current dir". -The list to the right of the "Options" selection should then become populated with a number of available ELF files for downloading and debugging. Select the one you want with a double click. In this case select "T32ThreadDebug.ino.elf". This will also show file attributes such as date, time and size. To select an ELF file from a custom directory, click the "File" button underneath the "User's choice" field and browse for the desired ELF file. You can opt for changing the behaviour of this script the next time it is executed. +The list to the right of the "Options" selection should then become populated with a number of available ELF files for downloading and debugging. Select the one you want with a double click. In this case select "T32ThreadDebug.ino.elf". This will also show file attributes such as date, time and size. To select an ELF file from a custom directory, click the "File" button underneath the "User's choice" field and browse for the desired ELF file. You can opt for changing the behavior of this script the next time it is executed. If the application has already been programmed to Flash, for instance via the Arduino IDE or a previous TRACE32 session, select "Load debug symbols (program is already in Flash)" to prevent an unnecessary erase and write cycle of the on-chip Flash memory. @@ -191,7 +192,7 @@ Lauterbach also provides hardware-based debug & trace tools. To learn more about - Update Arduino IDE to the latest version available - Update **Arduino mbed-enabled Boards** core from Arduino IDE menu: **Tools > Board > Boards Manager** -- Update the Portenta's bootloader using the instructions found [here](https://www.arduino.cc/pro/tutorials/portenta-h7/updating-the-bootloader). +- [Update the Portenta's bootloader using the instructions](https://www.arduino.cc/pro/tutorials/portenta-h7/updating-the-bootloader). ### Error Message in AREA View: 'No More Arguments Expected' diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-usb/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-usb/content.md index e25f68dcaa..3243125076 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-usb/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/por-ard-usb/content.md @@ -20,24 +20,25 @@ software: - ide-v2 - web-editor --- + ## Overview It is possible to configure the Portenta H7 to act as a USB host in a way that allows to connect peripherals such as a keyboard or mouse to interact with the board. This way you could connect a keyboard to your Portenta and type numbers or characters to trigger actions from your sketch. ## Goals -- How to configure the Portenta H7 as a USB host -- How to use the **KeyboardController** library to establish a USB connection with the Portenta H7 -- To write a small program that reads button presses from a keyboard -- How to debug the data being sent from the peripheral to the Portenta H7 using an additional Arduino board. +- How to configure the Portenta H7 as a USB host +- How to use the **KeyboardController** library to establish a USB connection with the Portenta H7 +- To write a small program that reads button presses from a keyboard +- How to debug the data being sent from the peripheral to the Portenta H7 using an additional Arduino board. ### Required Hardware and Software -- Portenta H7 (ABX00042), Portenta H7 Lite Connected (ABX00046) or Portenta H7 Lite (ABX00045) board () -- USB-C cable (either USB-A to USB-C or USB-C to USB-C) -- Active USB-C hub (optional) -- External keyboard -- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ -- Power supply for the USB hub (if a USB hub is used) +- [Portenta H7 (ABX00042)](https://store.arduino.cc/products/portenta-h7), [Portenta H7 Lite (ABX00045)](https://store.arduino.cc/products/portenta-h7-lite) or [Portenta H7 Lite Connected (ABX00046)](https://store.arduino.cc/products/portenta-h7-lite-connected) +- USB-C cable (either USB-A to USB-C or USB-C to USB-C) +- Active USB-C hub (optional) +- External keyboard +- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ +- Power supply for the USB hub (if a USB hub is used) ### Extra Materials @@ -60,7 +61,9 @@ Furthermore, the Portenta H7 can also be set to be a mouse or keyboard itself. W ### Setting Up the USB Host In this tutorial you are going to configure your Portenta H7 as a USB Host. This will allow you to toggle the RGB built-in LEDs of the board by pressing the corresponding keys (r, g, b) on a USB keyboard that will be plugged into a USB hub. + Throughout the tutorial, you will learn how to establish a serial communication between the board and the keyboard and also, how to program the board so it acts as a USB Host device. + To achieve this you will use the [USBHOST](https://os.mbed.com/handbook/USBHost) library which is part of the Portenta H7 core. This library facilitates the USB connections between USB devices and and the Portenta board. Thanks to USB OTG (On The Go) specification the Portenta H7 can switch between host and client modes automatically. The code that enables USB OTG in Portenta H7 is included in the **mbed** core and it is ready to function without additional configurations. Some related classes to make use of the USB port for different use cases are: @@ -84,14 +87,13 @@ As programming the USB protocol that allows the board to handle USB devices is a ![Select the Arduino Portenta H7 (M7 core) in the board selector](assets/por_ard_usbh_select_board.png) -Then, open: File>Examples>USBHOST>KeyboardController +Then, open: **File > Examples > USBHOST > KeyboardController**. ![Open the KeyboardController example](assets/por_ard_usbh_select_example.png) The **USBHost** library that is used in this example is a revamp of the classic Arduino **USBHost** library. This new version, among adapting the protocol to the newer USB version, allows to connect devices through USB Hubs (USB adapters). For a better understanding about how the USBHost library works, it could be helpful for you to take a look at the Arduino [USBHost](https://www.arduino.cc/en/Reference/USBHost) library. -**Note:** You can find the finished sketch in the examples of the Arduino_Pro_Tutorials library: -**Examples -> Arduino_Pro_Tutorials -> Portenta H7 as a USB Host -> LEDKeyboardController** +**Note:** You can find the finished sketch in the examples of the Arduino_Pro_Tutorials library: **Examples > Arduino_Pro_Tutorials > Portenta H7 as a USB Host > LEDKeyboardController** ### 3. Detecting the Keys From the Keyboard @@ -140,7 +142,7 @@ Then, in order to modify the state of the LEDs of the board with the R, G or B k ### 4. Initializing the LEDs -Once you have the code that detects if the correct keys are pressed and controls the LEDs accordingly, you need to initialise the LEDs. To do so, add the following portion of code inside the `setup()` function. +Once you have the code that detects if the correct keys are pressed and controls the LEDs accordingly, you need to initialize the LEDs. To do so, add the following portion of code inside the `setup()` function. ```cpp pinMode(LEDR, OUTPUT); pinMode(LEDG, OUTPUT); @@ -176,17 +178,17 @@ When you connect the Portenta board to the computer to program it, the computer In the image above you can see that: -+ The Portenta is connected to the "HOST" port of the USB hub (USB-C adapter) -+ The USB Hub (USB-C adapter) needs to be powered externally with a power supply. This is required to provide power to Portenta. -+ You should connect the keyboard to the USB Hub (USB-C adapter) in the same way you would connect it to your PC. +- The Portenta is connected to the "HOST" port of the USB hub (USB-C adapter) +- The USB Hub (USB-C adapter) needs to be powered externally with a power supply. This is required to provide power to Portenta. +- You should connect the keyboard to the USB Hub (USB-C adapter) in the same way you would connect it to your PC. ### Alternative Configuration (No USB Hub Required) If you don't have a USB-C type hub you may complete this tutorial with a USB-C type keyboard or with a USB A type keyboard and a USB A to C adapter. To do so proceed as follows: -+ Power the Portenta H7 through the VIN pin with 5V. (Check [pinout diagram](https://content.arduino.cc/assets/Pinout-PortentaH7_latest.pdf)) -+ Connect the keyboard directly to the Portenta's USB-C connector (use a USB-A to USB-C adapter if your keyboard's connector is USB type A) -+ Add the following line of code in your sketch to enable power supply through Portenta's USB connector: `usb.supplyPowerOnVBUS(true);` +- Power the Portenta H7 through the VIN pin with 5V. (Check [pinout diagram](https://content.arduino.cc/assets/Pinout-PortentaH7_latest.pdf)) +- Connect the keyboard directly to the Portenta's USB-C connector (use a USB-A to USB-C adapter if your keyboard's connector is USB type A) +- Add the following line of code in your sketch to enable power supply through Portenta's USB connector: `usb.supplyPowerOnVBUS(true);` ### 7. Toggling the LEDs diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/por-openmv-gs/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/por-openmv-gs/content.md index 4738dd4d14..2177d3a601 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/por-openmv-gs/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/por-openmv-gs/content.md @@ -18,17 +18,20 @@ hardware: software: - openMV --- + ## Overview The OpenMV IDE is meant to provide an Arduino like experience for simple machine vision tasks using a camera sensor. In this tutorial, you will learn about some of the basic features of the OpenMV IDE and how to create a simple MicroPython script. ## Goals + - The basic features of the OpenMV IDE - How to create a simple MicroPython script - How to use the OpenMV IDE to run MicroPython on Portenta H7 ### Required Hardware and Software -- Portenta H7 (ABX00042), Portenta H7 Lite Connected (ABX00046) or Portenta H7 Lite (ABX00045) board () + +- [Portenta H7 (ABX00042)](https://store.arduino.cc/products/portenta-h7), [Portenta H7 Lite (ABX00045)](https://store.arduino.cc/products/portenta-h7-lite) or [Portenta H7 Lite Connected (ABX00046)](https://store.arduino.cc/products/portenta-h7-lite-connected) - USB-C cable (either USB-A to USB-C or USB-C to USB-C) - Portenta Bootloader Version 20+ - OpenMV IDE 2.6.4+ @@ -84,7 +87,7 @@ import pyb # Import module for board related functions 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). -Now we can create the variables that will control our built-in RGB LED. With `pyb` we can easily control each colour. +Now we can create the variables that will control our built-in RGB LED. With `pyb` we can easily control each color. ```python redLED = pyb.LED(1) # built-in red LED @@ -96,7 +99,7 @@ Now we can easily distinguish between which color we control in the script. ### 4. Creating the Main Loop in the Script -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 colour. +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. ```python while True: @@ -157,11 +160,14 @@ Now the built-in LED on your Portenta board should be blinking red, green and th In this tutorial you learned how to use the OpenMV IDE with your Portenta board. You also learned how to control the Portenta H7's RGB LED with MicroPython functions and to upload the script to your board using the OpenMV IDE. ### Next Steps -- 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. -- 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) + +- 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. +- 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). ## Troubleshooting + ### OpenMV Firmware Flashing Issues + - 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. - 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. - 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. diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/updating-the-bootloader/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/updating-the-bootloader/content.md index 90b992b041..fc045106fb 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/updating-the-bootloader/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/updating-the-bootloader/content.md @@ -20,14 +20,16 @@ software: This tutorial will explain what a bootloader is, why you should consider keeping it updated and how you can update it. The Portenta H7 also features a second ST ROM bootloader which is a separate mechanism that we don't cover in this tutorial. For the remainder of this tutorial, when we reference a bootloader, the custom bootloader provided by Arduino is meant. ## Goals -- The concept of a bootloader -- How to use the Arduino IDE board manager to update the Portenta core -- How to use the Arduino IDE to update the Portenta bootloader to the latest version + +- The concept of a bootloader +- How to use the Arduino IDE board manager to update the Portenta core +- How to use the Arduino IDE to update the Portenta bootloader to the latest version ### Required Hardware and Software -- Portenta H7 (ABX00042), Portenta H7 Lite Connected (ABX00046) or Portenta H7 Lite (ABX00045) board () -- USB C cable (either USB A to USB C or USB C to USB C) -- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ + +- [Portenta H7 (ABX00042)](https://store.arduino.cc/products/portenta-h7), [Portenta H7 Lite (ABX00045)](https://store.arduino.cc/products/portenta-h7-lite) or [Portenta H7 Lite Connected (ABX00046)](https://store.arduino.cc/products/portenta-h7-lite-connected) +- USB C cable (either USB A to USB C or USB C to USB C) +- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ ## What Is a Firmware? @@ -39,7 +41,7 @@ In order to understand how a bootloader works we first need to understand what a A bootloader is a small application that gets started when an Arduino board gets powered. When you order an official Arduino board it comes pre-flashed with a bootloader. -The bootloader helps to upload a new sketch to the board. If the bootloader wasn't there you would need an external programmer device to upload your sketch to the board. The bootloader determines whether it should upload a new firmware or if it should launch an existing one that was uploaded previously. If you don't take any action the bootloader launches an existing firmware. On the other hand, when you double press the reset button on the board the bootloader recognises that and waits for a firmware to be uploaded. The bootloader then takes care of storing the new firmware in the memory. +The bootloader helps to upload a new sketch to the board. If the bootloader wasn't there you would need an external programmer device to upload your sketch to the board. The bootloader determines whether it should upload a new firmware or if it should launch an existing one that was uploaded previously. If you don't take any action the bootloader launches an existing firmware. On the other hand, when you double press the reset button on the board the bootloader recognizes that and waits for a firmware to be uploaded. The bootloader then takes care of storing the new firmware in the memory. ![This chart shows a simplified version of the steps the Portenta goes through when it boots](assets/por_ard_bl_booting_process.svg) @@ -47,7 +49,7 @@ The bootloader helps to upload a new sketch to the board. If the bootloader wasn Both the bootloader and the firmware have predefined (but adjustable) locations in the memory where they get stored. In the end, the processor needs to know where to find the instructions to do its work. On the Portenta for example the bootloader is stored at the Flash memory address `0x08000000`. When the board gets powered on it will jump to this location and start to do its job. The bootloader in turn knows that e.g. for the M7 the firmware can be found at location `0x08040000` so it will jump there if it doesn't need to upload a new firmware. -![There are predefinded, but adjustable locations in the memory where the firmwares and the bootloader get installed](assets/por_ard_bl_flash_memory.svg) +![There are predefined, but adjustable locations in the memory where the firmware and the bootloader get installed](assets/por_ard_bl_flash_memory.svg) ## Instructions @@ -58,7 +60,7 @@ Even though the Arduino boards come pre-flashed with a bootloader there are some The bootloader is stored in a location that doesn't get overwritten by a firmware being uploaded to the Portenta. If you upload for example the OpenMV firmware and then later decide to switch back to a regular Arduino firmware the bootloader won't be affected. ### 1. Updating the Core -New versions of the bootloader normally get shipped together with the core. That means you first have to update the core before you can update the bootloader. To do so open the board manager in the menu under **Tools->Board->Boards Manager...** +New versions of the bootloader normally get shipped together with the core. That means you first have to update the core before you can update the bootloader. To do so open the board manager in the menu under **Tools >Board >Boards Manager...** ![Open the Boards Manager from the Tools menu](assets/por_ard_bl_boards_manager.png) diff --git a/content/hardware/04.pro/boards/portenta-x8/tutorials/out-of-the-box/content.md b/content/hardware/04.pro/boards/portenta-x8/tutorials/out-of-the-box/content.md index bfe2dc08ff..e371ede07b 100644 --- a/content/hardware/04.pro/boards/portenta-x8/tutorials/out-of-the-box/content.md +++ b/content/hardware/04.pro/boards/portenta-x8/tutorials/out-of-the-box/content.md @@ -123,8 +123,9 @@ You have plenty of ways to communicate with your board, be it wirelessly or with ### ADB -First of all, make sure you have the latest **Mbed OS Portenta Core**, which contains the adb program. -You can go to its directory inside the **Arduino15/packages/arduino/tools/adb/32.0.0**. To check the tool you can use your teminal and type `adb`, you should get feedback from the tool when typing this. +First of all make sure you have the latest **Mbed OS Portenta Core**, which contains the adb program. + +You can go to its directory inside the **Arduino15/packages/arduino/tools/adb/32.0.0**. To check the tool you can use your terminal and type `adb`, you should get feedback from the tool when typing this. To know the list of devices that can be accessed type `adb devices`. @@ -139,6 +140,7 @@ SSH is commonly used for remote control on different kinds of devices running di To communicate with your board, you will need to know the IP of it, and just type `ssh fio@`, then the terminal workaround should be the same as ADB. The password is `fio`. ![SSH connection](assets/ssh-connection.png) + As it is a linux device, you can do normal stuff like creating files, changing directory, etc. To gain admin (root) access, type `sudo su -` and the password is `fio` after that the terminal prefix should turn red. @@ -171,4 +173,4 @@ Make sure the name is not already being used in your Factory. Run: `journalctl -f` to see what's going on on the device -![Real time tasks on CLI](assets/command-journalctl.png) +![Real time tasks on CLI](assets/command-journalctl.png) \ No newline at end of file diff --git a/content/hardware/04.pro/carriers/edge-control/tutorials/ec-ard-3wirevalve/content.md b/content/hardware/04.pro/carriers/edge-control/tutorials/ec-ard-3wirevalve/content.md index 8bff21538d..3a1ffe8893 100644 --- a/content/hardware/04.pro/carriers/edge-control/tutorials/ec-ard-3wirevalve/content.md +++ b/content/hardware/04.pro/carriers/edge-control/tutorials/ec-ard-3wirevalve/content.md @@ -15,19 +15,19 @@ A ball valve is a form of quarter-turn [valve](https://en.wikipedia.org/wiki/Val ## Goals -- How to connect a motorized valve to the Edge Control board -- How to control the valve through basic commands provided by the `Arduino_EdgeControl` library -- How to power the board with an external power supply +- How to connect a motorized valve to the Edge Control board +- How to control the valve through basic commands provided by the `Arduino_EdgeControl` library +- How to power the board with an external power supply ### Required Hardware and Software -- 1 x [Arduino Edge control board](https://store.arduino.cc/edge-control) -- 1 x [US Solid Motorised Ball Valve (9 - 24 V)](https://ussolid.com/u-s-solid-motorized-ball-valve-1-2-brass-electrical-ball-valve-with-full-port-9-24-v-ac-dc-3-wire-setup.html) (or compatible) -- External power source: 12V battery (LiPo / SLA) or power supply -- 1 x Micro USB cable -- Arduino IDE 1.8.10+ -- 2 x Phoenix Connectors -- 2 x Jumper cables +- [Arduino Edge control board](https://store.arduino.cc/edge-control) +- 1x [US Solid Motorised Ball Valve (9 - 24 V)](https://ussolid.com/u-s-solid-motorized-ball-valve-1-2-brass-electrical-ball-valve-with-full-port-9-24-v-ac-dc-3-wire-setup.html) (or compatible) +- External power source: 12V battery (LiPo / SLA) or power supply +- 1x Micro USB cable +- Arduino IDE 1.8.10+ +- 2x Phoenix Connectors +- 2x Jumper cables ## Instructions @@ -73,6 +73,7 @@ void setup(){ Serial.println("Starting"); } ``` + As mentioned earlier, the 2 Input Pins of the latching circuit are primarily used to control the direction of the output signal. The `` provides various methods to access and control these pins. The command `Latching.chennalDirection(LATCHING_OUT_1, direction)` is a method that can be used to assign a signal direction to a specific pin on the board through the parameters. Inside the `loop()` you will add the instructions to open and close the valve. `Latching.channelDirection()` with the parameter `LATCHING_OUT_1` to access the 1N:1P pins and the parameters, `POSITIVE` or `NEGATIVE` for the direction. If you want the valve to open you can use the function as such, diff --git a/content/hardware/04.pro/carriers/edge-control/tutorials/ec-ard-gs/content.md b/content/hardware/04.pro/carriers/edge-control/tutorials/ec-ard-gs/content.md index b77ee73644..efb510aba1 100644 --- a/content/hardware/04.pro/carriers/edge-control/tutorials/ec-ard-gs/content.md +++ b/content/hardware/04.pro/carriers/edge-control/tutorials/ec-ard-gs/content.md @@ -11,18 +11,18 @@ author: Lenard George The Edge Control board is a versatile tool that allows agriculturalists to develop creative and innovative solutions for agriculture by harnessing modern technology. In this tutorial you will set up the development environment for the board and learn to write a simple sketch that blinks the on-board LED. ## Goals -- About the basic board topology -- How to setup the development environment -- How to power up the board -- About the basic API provided by the Arduino_EdgeControl library +- About the basic board topology +- How to setup the development environment +- How to power up the board +- About the basic API provided by the Arduino_EdgeControl library ### Required Hardware and Software -- Arduino Edge Control () -- Micro USB cable -- Arduino IDE 1.8.10+ -- External power source : a 12V SLA battery or 12V power supply -- 1x Connector -- 2x Jumper wires +- [Arduino Edge Control](https://store.arduino.cc/edge-control) +- Micro USB cable +- Arduino IDE 1.8.10+ +- External power source: a 12V SLA battery or 12V power supply +- 1x Connector +- 2x Jumper wires ## Instructions @@ -41,7 +41,7 @@ The Arduino Edge Control board is designed to address the needs of **precision f - **16** x **Watermark Sensors** - **16** x **Latching Devices** (e.g. Motorized Valves) - and provides **4** x **configurable Solid State Relays**. +and provides **4** x **configurable Solid State Relays**. ***Connections to the Terminal blocks are made through the connectors included in the kit.*** @@ -91,13 +91,13 @@ Power.enable3V3(); Power.enable5V(); ``` -Communication to the I/O Expander happens through the I2C port which we initialise with `Wire.begin()`. We also need to initialise the expander and configure the LED pin as OUTPUT. +Communication to the I/O Expander happens through the I2C port which we initialize with `Wire.begin()`. We also need to initialize the expander and configure the LED pin as OUTPUT. ```cpp // Start the I2C connection Wire.begin(); -// Initialise the expander pins +// Initialize the expander pins Expander.begin(); Expander.pinMode(EXP_LED1, OUTPUT); ``` @@ -149,7 +149,7 @@ void setup() { // Start the I2C connection Wire.begin(); - // Initialise the expander pins + // Initialize the expander pins Expander.begin(); Expander.pinMode(EXP_LED1, OUTPUT); } diff --git a/content/hardware/04.pro/carriers/portenta-breakout/tutorials/breakout-jlink-setup/breakout-jlink-setup.md b/content/hardware/04.pro/carriers/portenta-breakout/tutorials/breakout-jlink-setup/breakout-jlink-setup.md index 927e4cf1ba..7932538e0e 100644 --- a/content/hardware/04.pro/carriers/portenta-breakout/tutorials/breakout-jlink-setup/breakout-jlink-setup.md +++ b/content/hardware/04.pro/carriers/portenta-breakout/tutorials/breakout-jlink-setup/breakout-jlink-setup.md @@ -10,17 +10,19 @@ author: Benjamin Dannegård This tutorial will show you how to debug an Arduino sketch using the Portenta H7, Portenta Breakout board and the Segger J-link device. Using the Arduino IDE we will build a version of the sketch so that it can be used in Segger's Ozone debugger. ## Goals -- How to debug an Arduino sketch -- How to connect the Portenta breakout to the Segger J-link device -- How to use the Segger J-link and Portenta with the Ozone debugger + +- How to debug an Arduino sketch +- How to connect the Portenta breakout to the Segger J-link device +- How to use the Segger J-link and Portenta with the Ozone debugger ### Required Hardware and Software -- Portenta H7 board () -- Portenta Breakout board () -- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ -- J-link adapter -- Segger J-link device -- Segger Ozone + +- [Portenta H7 board](https://store.arduino.cc/portenta-h7) +- [Portenta Breakout board](https://store.arduino.cc/portenta-breakout) +- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ +- J-link adapter +- Segger J-link device +- Segger Ozone ## Instructions ### 1. Setting up with the Arduino IDE diff --git a/content/hardware/04.pro/carriers/portenta-breakout/tutorials/getting-started/content.md b/content/hardware/04.pro/carriers/portenta-breakout/tutorials/getting-started/content.md index d28d79c888..39de5b5e4a 100644 --- a/content/hardware/04.pro/carriers/portenta-breakout/tutorials/getting-started/content.md +++ b/content/hardware/04.pro/carriers/portenta-breakout/tutorials/getting-started/content.md @@ -10,51 +10,53 @@ author: Manuel Zomer, Pablo Marquínez, Sebastian Romero The Arduino Portenta Breakout is a versatile tool designed for developing, testing and debugging on Portenta family boards. In this tutorial you will set up the development environment for the Portenta Breakout and learn some of its simple functionalities using the **Breakout Carrier Library**. ## Goals -- About the Portenta Breakout's layout and functions -- How to setup the development environment -- How to use the Arduino_PortentaBreakout library -- Control an external LED using one of the carriers PWM pins -- Read an external potentiometer using an analog pin on the carrier + +- About the Portenta Breakout's layout and functions +- How to setup the development environment +- How to use the Arduino_PortentaBreakout library +- Control an external LED using one of the carriers PWM pins +- Read an external potentiometer using an analog pin on the carrier ### Required Hardware and Software -- Arduino Portenta H7 () -- Arduino Portenta Breakout () -- USB C cable (either USB A to USB C or USB C to USB C) -- Breadboard & Cables -- Pin headers for the Portenta Breakout -- LED & Resistor -- Potentiometer -- Arduino IDE 1.8.10+ + +- [Arduino Portenta H7](https://store.arduino.cc/portenta-h7) +- [Arduino Portenta Breakout](https://store.arduino.cc/portenta-breakout) +- USB C cable (either USB A to USB C or USB C to USB C) +- Breadboard & Cables +- Pin headers for the Portenta Breakout +- LED & Resistor +- Potentiometer +- Arduino IDE 1.8.10+ ## Instructions ### 1. Get to Know the Carrier -The Protenta Breakout is made to reduce development time and gives access to the Portenta's High Density connectors as well as features Ethernet, USBA, a JTAG connector and more. For this tutorial however, we will focus on using the **Arduino_PortentaBreakout** library to get access to the High Density connectors and create some simple example use cases. +The Portenta Breakout is made to reduce development time and gives access to the Portenta's High Density connectors as well as features Ethernet, USBA, a JTAG connector and more. For this tutorial however, we will focus on using the **Arduino_PortentaBreakout** library to get access to the High Density connectors and create some simple example use cases. -![Parts of the BreakoutBoard](assets/breakout_gs_main_parts.svg) +![Parts of the Portenta Breakout board](assets/breakout_gs_main_parts.svg) ### 2. The Basic Setup -As part of this tutorial we will create two sample use cases for the **Arduino_PortentaBreakout** library: starting with using the Breakout's PWM pins to connect an LED and fade its brightness high ad low. Secondly we will connect an external potentiometer to showcase how to use the Breakout to read an analog input. In order to use the pins on the breakout to connect external components as described in this tutorial, pin headers have to be soldered on to the used pins. We recommend using double row pin headers. +As part of this tutorial we will create two sample use cases for the **Arduino_PortentaBreakout** library: starting with using the Portenta Breakout's PWM pins to connect an LED and fade its brightness high ad low. Secondly we will connect an external potentiometer to showcase how to use the Portenta Breakout to read an analog input. In order to use the pins on the Portenta Breakout to connect external components as described in this tutorial, pin headers have to be soldered on to the used pins. We recommend using double row pin headers. -After having prepared the Breakout by soldering on pin headers we can start using it. The board comes with two DIP switches called **BOOT** and **BT_SEL**. These switches are used to keep the Portenta in either boot-mode (BT_SEL switch) or to enable the embedded bootloader (BOOT switch) to upload firmware via the USB port on the Breakout. For this tutorial we have to make sure, to set both DIP switches in the **OFF** position. Having done that we can connect the Portenta H7 to the Breakout using the two high density connectors in the orientation showcased by the dashed line on the Breakout Carrier. +After having prepared the Portenta Breakout by soldering on pin headers we can start using it. The board comes with two DIP switches called **BOOT** and **BT_SEL**. These switches are used to keep the Portenta in either boot-mode (BT_SEL switch) or to enable the embedded bootloader (BOOT switch) to upload firmware via the USB port on the Portenta Breakout. For this tutorial we have to make sure, to set both DIP switches in the **OFF** position. Having done that we can connect the Portenta H7 to the Portenta Breakout using the two high density connectors in the orientation showcased by the dashed line on the Portenta Breakout. ![Dip switch on the Breakout](assets/breakout_gs_dip_switch.svg) ### 3. The Circuit -In order to build this example's circuit we need our Breakout Carrier with the Portenta H7 on top and headers soldered on (at least within the ANALOG/PWM and GPIO section on the bottom right corner of the carrier). Then we need a simple LED, an adequate resistor for it (we are using a 220Ω resistor) as well as a potentiometer. To connect all these components we use jumper wires and a breadboard by following this schematic: +In order to build this example's circuit we need our Portenta Breakout with the Portenta H7 on top and headers soldered on (at least within the ANALOG/PWM and GPIO section on the bottom right corner of the carrier). Then we need a simple LED, an adequate resistor for it (we are using a 220Ω resistor) as well as a potentiometer. To connect all these components we use jumper wires and a breadboard by following this schematic: ![Connecting the LEDS and the Portenta](assets/breakout_gs_circuit_diagram.svg) -For the LED we can use any of the Breakout Carrier's 10 PWM Pins, in this case **PWM 9**. For the potentiometer on the other hand we can use one of the analog pins A0 to A7 in order to read the the potentiometers current value, in this example we use **A7**. For the potentiometer we also need a 3.3V power source, which we take from the GPIO section on the Breakout Carrier, considering it being located most conveniently and closeby. Lastly Potentiometer and LED have to be connected to GND and the circuit is finished. +For the LED we can use any of the Portenta Breakout's 10 PWM Pins, in this case **PWM 9**. For the potentiometer on the other hand we can use one of the analog pins A0 to A7 in order to read the the potentiometers current value, in this example we use **A7**. For the potentiometer we also need a 3.3V power source, which we take from the GPIO section on the Portenta Breakout, considering it being located most conveniently and close by. Lastly Potentiometer and LED have to be connected to GND and the circuit is finished. After having connected everything the Portenta H7 can be plugged into the computer using a USBC cable and we can start with the code. ### 4. The Arduino_PortentaBreakout Library In the Arduino IDE we create a new Sketch and make sure we have selected the Arduino Portenta H7 on the M7 core, if you haven't used the Portenta H7 before, [here](/tutorials/portenta-h7/por-ard-gs) is a detailed tutorial on how to get started with it. -In order to use the pins on the Breakout Carrier we need to install the **Arduino_PortentaBreakout** Library which allows us to address all the pins located on the Carrier. Therefore we need to download the library using the library manager by going to **Sketch -> Include Libraries -> Manage Libraries** and search for **Arduino_PortentaBreakout**. +In order to use the pins on the Portenta Breakout we need to install the **Arduino_PortentaBreakout** Library which allows us to address all the pins located on the Carrier. Therefore we need to download the library using the library manager by going to **Sketch > Include Libraries > Manage Libraries** and search for **Arduino_PortentaBreakout**. -Once we have installed the Breakout Carrier library we can import it to our Sketch. +Once we have installed the Portenta Breakout library we can import it to our Sketch. ```cpp #include @@ -97,7 +99,7 @@ void loop() { When uploading the sketch to the board we should now see the LED fading up and down in brightness. If that works as expected, we can proceed with connecting the potentiometer to our code. -### Analog Inputs Through the Breakout Carrier +### Analog Inputs Through the Portenta Breakout Similar to the PWM code we need to define our pinNumber first, we will also create a variable to save the last value potentiometer value that has been read. Before the `setup()`function we therefore specify the following: ```cpp @@ -373,4 +375,4 @@ This section includes a table of reference regarding the **Arduino_PortentaBreak ### Next Steps -More examples on how to use the Portenta Breakout can be found in the examples menu in the IDE after installing the library. They can be found under **File->Examples->Arduino_PortentaBreakout**. \ No newline at end of file +More examples on how to use the Portenta Breakout can be found in the examples menu in the IDE after installing the library. They can be found under **File > Examples > Arduino_PortentaBreakout**. \ No newline at end of file diff --git a/content/hardware/04.pro/carriers/portenta-machine-control/_unlisted/pmc_hmi_demo/pmc_hmi_demo.md b/content/hardware/04.pro/carriers/portenta-machine-control/_unlisted/pmc_hmi_demo/pmc_hmi_demo.md index 07d4483f3e..74097a14d7 100644 --- a/content/hardware/04.pro/carriers/portenta-machine-control/_unlisted/pmc_hmi_demo/pmc_hmi_demo.md +++ b/content/hardware/04.pro/carriers/portenta-machine-control/_unlisted/pmc_hmi_demo/pmc_hmi_demo.md @@ -30,10 +30,11 @@ With this set up we have two devices that operate on their own, but they can exc For example, when a button is touched on the screen, it sends the button **ID** and the **type of press** through the serial communication. On the Arduino sketch side you can have a callback for that button and add reactions for the PMC to the button press. ### Required Hardware & Software -- Portenta Machine Control (PMC) + +- [Portenta Machine Control (PMC)](https://store.arduino.cc/products/arduino-portenta-machine-control) - Portenta H7 (Included with the Machine Control Carrier) -- x6 Jumper Wires (connection between PMC and HMI) -- x2 Jumper Wires (connection between Power supply and PMC) +- 6x Jumper Wires (connection between PMC and HMI) +- 2x Jumper Wires (connection between Power supply and PMC) - Micro USB - Male USB-A to Male USB-A (upload UI to the HMI) - Stone Designer v210601 (Only for Windows) @@ -45,7 +46,7 @@ For example, when a button is touched on the screen, it sends the button **ID** Below you can find a table that shows which connections to make between the HMI and PMC. Connect the HMI and PMC according to the table below. The PMC will also need to be powered by a external power supply of 24V and minimum 0.2A. -> **The PMC + HMI consumes ~0.2A, if you connect more devices to the PMC you will need more current** +***The PMC + HMI consumes ~0.2A, if you connect more devices to the PMC you will need more current.*** ![How to connect the HMI and PMC](assets/HMI_PMC_connection.png) @@ -286,7 +287,7 @@ void setup(){ // PMC //Configure Digital outputs - digital_outputs.setLatch(); //setup overcurrent behaviour on all channels. + digital_outputs.setLatch(); //setup overcurrent behavior on all channels. digital_outputs.setAll(0); //At startup set all channels (0-255) //Analog inputs diff --git a/content/hardware/04.pro/shields/portenta-cat-m1-nb-iot-gnss-shield/tutorials/cheat-sheet/cheat-sheet.md b/content/hardware/04.pro/shields/portenta-cat-m1-nb-iot-gnss-shield/tutorials/cheat-sheet/cheat-sheet.md index 98d5bff076..9880edc209 100644 --- a/content/hardware/04.pro/shields/portenta-cat-m1-nb-iot-gnss-shield/tutorials/cheat-sheet/cheat-sheet.md +++ b/content/hardware/04.pro/shields/portenta-cat-m1-nb-iot-gnss-shield/tutorials/cheat-sheet/cheat-sheet.md @@ -36,13 +36,13 @@ The Arduino® Portenta Cat. M1/NB IoT GNSS Shield uses the libraries from the [A ### Arduino IDE 1.8.X -The Arduino® Portenta Cat. M1/NB IoT GNSS Shield can be programmed through the **Classic Arduino IDE 1.8.X**. To install your board, you can check out the guide below: +The Portenta Cat. M1/NB IoT GNSS Shield can be programmed through the **Classic Arduino IDE 1.8.X**. To install your board, you can check out the guide below: - [Installing the Arduino Mbed OS Portenta Boards core](/software/ide-v1/tutorials/getting-started/cores/arduino-mbed_portenta) ### Arduino IDE 2.0.X -The Arduino® Portenta Cat. M1/NB IoT GNSS Shield can be programmed through the **Arduino IDE 2**. To install your board, you can check out the guide below: +The Portenta Cat. M1/NB IoT GNSS Shield can be programmed through the **Arduino IDE 2**. To install your board, you can check out the guide below: - [How to use the board manager with the Arduino IDE 2.0](https://www.arduino.cc/en/Tutorial/getting-started-with-ide-v2/ide-v2-board-manager) @@ -54,19 +54,22 @@ The board can be programmed through the **Web Editor**. To get started with your ## Pins As a Portenta family Shield it uses the High density pins to be available for the Portenta board which is being connected. -![The pinout of the Arduino® Portenta Cat. M1/NB IoT GNSS Shield.](assets/ASX00027-pinout.png) + +![The pinout of the Portenta Cat. M1/NB IoT GNSS Shield.](assets/ASX00027-pinout.png) ## GSM ### Requirements The GPS Feature requires: + * An antenna (e.g [Dipole antenna, at the Arduino store](https://store.arduino.cc/products/dipole-pentaband-waterproof-antenna) at the **RF OUT** antenna connector on the top side of the shield. * SIM Card capable of running with the CatM1 specifications (check with your provider if your Card has that feature) To check if our setup it's working we can open an example sketch from the GSM library inside the Mbed Portenta Core. Under **Examples > GSM > GSMClient** we open a sketch that connects to the SIM card provider, then connects to a webpage and downloads the content of it to display it inside the Serial Monitor. Make sure you go to the `arduino_secrets.h` tab and: + * Enter the PIN of your SIM card and store it at `SECRET_PIN`. * Check the mobile APN of your SIM card provider, e.g "online.provider.com" and save it inside the `SECRET_APN` You can find it by searching Google for APN + provider name. @@ -100,7 +103,7 @@ This library contains some commands that are quite different, that's because it #### Connect to Your Provider You need to enter the Pin code and the APN link of your provider. -The user name and password depend on your provider. They are required to authenticate with the APN gateway. The values can usually be found by searching Google for APN crediantials + provider name. Sometimes they can be left blank. +The user name and password depend on your provider. They are required to authenticate with the APN gateway. The values can usually be found by searching Google for APN credentials + provider name. Sometimes they can be left blank. This sketch will initialize the SIM card and connect to your provider's network @@ -192,12 +195,14 @@ void loop() { ### Requirements The GPS Feature requires: + * A GPS active antenna (e.g [GPS active antenna 28dB](https://www.digikey.com/en/products/detail/adafruit-industries-llc/960/5353630)) at the **GNS ANT** antenna connector on the Top side of the shield. * You may need a connector converter from the active GPS antenna, we used this one [Coaxial to SMA](https://www.digikey.com/en/products/detail/taoglas-limited/CAB.719/3664639) To check if our setup it's working we can open an example inside the GSM library from the Mbed Portenta Core, going to **Examples > GSM > GNSSClient** we will open an sketch that connects to the SIM card provider and initialize the active GPS antenna, then it will print out GPS readings. Make sure you go to the `arduino_secrets.h` tab and: + * introduce the PIN of the SIM card you are using and store it at `SECRET_PIN`. * Browse to your IT provider and check the mobile APN link, e.g "online.provider.com" save it inside the `SECRET_APN` @@ -220,7 +225,8 @@ Make sure you go to the `arduino_secrets.h` tab and: #### Get GPS Data The following example connects to the GSM provider, then initialize the GPS antenna, gets the data and print it out on the Serial monitor. As you previously done, you need to provide the GSM data by filling in the secrets in `arduino_secrets.h` -Open the example by going to **Examples > GSM > GNSSClient** + +Open the example by going to **Examples > GSM > GNSSClient**. ```arduino #include @@ -259,11 +265,13 @@ Open the example by going to **Examples > GSM > GNSSClient** ***Remember to connect to the GSM provider and secondly connect to the GNSS (mandatory).*** You will see the **NMEA** data in the Serial monitor. + ![NMEA log example Serial Monitor](assets/NMEA_output.png) #### Parse NMEA GPS Sentences Previously we went through how to show the GPS data in the Serial Monitor, but it was not possible to evaluate those messages (NMEA sentences). + To do so you can use an **NMEA parser** this will convert the messages received from the GPS modem, parsing and saving them into variables. You can use the **107-Arduino-NMEA-Parser** library. This library can be found in the library manager inside the Arduino IDE. This makes it possible to interact with the data that you need for your application, for example if you only want to get the latitude and longitude. You will be able to save those needed values into variables, instead of having the whole NMEA messages. @@ -313,6 +321,7 @@ Edit the loop to parse the `GPS` readings instead of the `Serial1`. #### Low Power GPS The GPS antenna is active, that means that it needs power to function as it has electronics inside of it. + One way to save power on your project is to enable the GPS module only when it is needed to read the data: ```cpp @@ -332,7 +341,7 @@ By using this method, you don't need to initialize the GPS inside the `setup()`. ## Conclusion -This cheat sheet is written as a quick reference, to look up the GSM and GPS feature of this product. For a more in-depth walkthrough experience please have a look at the other tutorials. +This cheat sheet is written as a quick reference, to look up the GSM and GPS feature of this product. For a more in-depth walk through experience please have a look at the other tutorials. ## Troubleshooting @@ -342,4 +351,4 @@ Make sure you included first the `GPS.h` library and then the `GSM.h` ### Can't Upload the Sketch -Sometimes if the GPS module is getting readings, you will not be able to upload a new sketch, double tap the reset button on your Potenta H7 and upload the new sketch. \ No newline at end of file +Sometimes if the GPS module is getting readings, you will not be able to upload a new sketch, double tap the reset button on your Portenta H7 and upload the new sketch. \ No newline at end of file diff --git a/content/hardware/04.pro/shields/portenta-cat-m1-nb-iot-gnss-shield/tutorials/getting-started/getting-started.md b/content/hardware/04.pro/shields/portenta-cat-m1-nb-iot-gnss-shield/tutorials/getting-started/getting-started.md index 7fe84a6a88..00bec7ddff 100644 --- a/content/hardware/04.pro/shields/portenta-cat-m1-nb-iot-gnss-shield/tutorials/getting-started/getting-started.md +++ b/content/hardware/04.pro/shields/portenta-cat-m1-nb-iot-gnss-shield/tutorials/getting-started/getting-started.md @@ -21,7 +21,7 @@ software: ## Introduction -This tutorial will show how to connect the Portenta Cat. M1/NB IoT GNSS shield to the Portenta H7, connect to a website using NBIoT or Cat-M1 technology and print the website's HTML content in the serial monitor. This will help you quickly find out if the setup successfully connects to mobile networks. +This tutorial will show how to connect the Arduino® Portenta Cat. M1/NB IoT GNSS shield to the Arduino® Portenta H7, connect to a website using NBIoT or Cat-M1 technology and print the website's HTML content in the serial monitor. This will help you quickly find out if the setup successfully connects to mobile networks. ***Note: This tutorial was created in Sweden, and as a result, the available networks are only Swedish network operators. The results will vary depending on what location you are in.*** @@ -54,7 +54,7 @@ Now connect the shield to the Portenta H7. Do this by attaching it to the HD con ### Arduino IDE -Make sure that you have the latest **Arduino Mbed OS Portenta core** installed. You can install it with the board manager under **Tools > Board > Board Manager...**. With the core installed and the board selected, navigate to **file > Examples > GSM > GSMClient**. This is the example sketch we will use to test out the Cat-M1 or NBIoT connection. +Make sure that you have the latest **Arduino Mbed OS Portenta core** installed. You can install it with the board manager under **Tools > Board > Board Manager...**. With the core installed and the board selected, navigate to **File > Examples > GSM > GSMClient**. This is the example sketch we will use to test out the Cat-M1 or NBIoT connection. ### Programming the Board diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-ard-eth/vs-ard-eth.md b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-ard-eth/vs-ard-eth.md index fa57cdda9b..eb13692ced 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-ard-eth/vs-ard-eth.md +++ b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-ard-eth/vs-ard-eth.md @@ -32,9 +32,9 @@ The goals of this project are: ### Hardware & Software Needed -- [Portenta H7 board](https://store.arduino.cc/portenta-h7) -- [Portenta Vision Shield - Ethernet](https://store.arduino.cc/usa/portenta-vision-shield) -- Arduino [offline](https://www.arduino.cc/en/main/software) IDE or Arduino [Web Editor](https://create.arduino.cc/) +- [Portenta H7](https://store.arduino.cc/portenta-h7) +- [Portenta Vision Shield - Ethernet](https://store.arduino.cc/products/arduino-portenta-vision-shield-ethernet) +- Arduino [offline IDE](https://www.arduino.cc/en/main/software) or Arduino [Web Editor](https://create.arduino.cc/) - Ethernet cable - USB-C cable @@ -58,7 +58,7 @@ Connect the Portenta Vision Shield Ethernet to the Portenta H7. Now connect the After everything is connected, make sure that you have the latest Portenta H7 core installed in the Arduino IDE. After the right board and port is selected, we can open an example that will help us make sure everything is working as it should. -In the Arduino IDE go to: **File->Examples->Ethernet->WebClient**. +In the Arduino IDE go to: **File > Examples > Ethernet > WebClient**. ![Where to find the example in the Arduino IDE](assets/VS-eth-ide-example.png) diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-ard-gs/content.md b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-ard-gs/content.md index 1ecf66ee3b..e168dbeac2 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-ard-gs/content.md +++ b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-ard-gs/content.md @@ -1,29 +1,31 @@ --- -title: Getting Started With The Vision Shield Camera +title: Getting Started With the Portenta Vision Shield Camera coverImage: assets/vs_ard_gs_cover.svg difficulty: easy tags: [Getting Started, Camera, Processing, Serial] -description: This tutorial shows you how to capture frames from the Vision Shield Camera module and visualise the video output through a Processing sketch. +description: This tutorial shows you how to capture frames from the Portenta Vision Shield Camera module and visualize the video output through a Processing sketch. author: Lenard George, Sebastian Romero --- ## Overview -This tutorial shows you how to capture frames from the Vision Shield Camera module and visualise the video output through a Processing sketch. +This tutorial shows you how to capture frames from the Arduino Portenta Vision Shield Camera module and visualize the video output through a Processing sketch. ## Goals + - Capturing the frames from the camera. - Sending the frames as a byte stream through a Serial connection. - Visualising the frames in Processing. ### Required Hardware and Software -- 1x [Portenta H7 board](https://store.arduino.cc/portenta-h7) -- 1x Portenta Vision Shield ( [LoRa](https://store.arduino.cc/portenta-vision-shield-lora) or [Ethernet](https://store.arduino.cc/portenta-vision-shield) ) + +- [Portenta H7](https://store.arduino.cc/portenta-h7) +- Portenta Vision Shield ([LoRa](https://store.arduino.cc/portenta-vision-shield-lora) or [Ethernet](https://store.arduino.cc/portenta-vision-shield)) - 1x USB-C cable (either USB-A to USB-C or USB-C to USB-C) - Arduino IDE 1.8.10+ - Processing 3.5.4+ ## Instructions -Accessing the Vision Shield's camera data is done with the help of both Arduino and the Processing IDE. The Arduino sketch handles the capture of image data by the on-board camera while the java applet created with Processing helps to visualise this data with the help of a serial connection. The following steps will run you through how to capture, package the data through the serial port and visualise the output in Processing. +Accessing the Vision Shield's camera data is done with the help of both Arduino and the Processing IDE. The Arduino sketch handles the capture of image data by the on-board camera while the java applet created with Processing helps to visualize this data with the help of a serial connection. The following steps will run you through how to capture, package the data through the serial port and visualize the output in Processing. ### 1. The Basic Setup Connect the Vision Shield to your Portenta H7 as shown in the figure. The top and bottom high density connecters are connected to the corresponding ones on the underside of the H7 board. Plug in the H7 to your computer using the USB C cable. @@ -44,14 +46,14 @@ To capture the frames you will need to use the functions contained in `camera.h` #include "camera.h" ``` -Next, let's initialise a camera object and a frame buffer of the size 320*240 (76'800 bytes). +Next, let's initialize a camera object and a frame buffer of the size 320*240 (76'800 bytes). ```cpp CameraClass cam; uint8_t fb[320*240]; ``` -In the `setup()` function, let's start the Serial communication at `921600` baud rate and iniitialise the camera using `cam.begin()`. +In the `setup()` function, let's start the Serial communication at `921600` baud rate and initialize the camera using `cam.begin()`. ```cpp void setup() { @@ -84,17 +86,17 @@ Open a new processing sketch file and name it `CameraCapture.pde`. ![Create a processing sketch](assets/vs_ard_open_pde_sketch.png) -Let's start by importing the libraries and initialising the variables you will need to process the captured data. To process the data sent by the Vision Shield you will need to import the following libraries: +Let's start by importing the libraries and initializing the variables you will need to process the captured data. To process the data sent by the Vision Shield you will need to import the following libraries: -- `processing.serial.*` : a [Serial Library](https://processing.org/reference/libraries/serial/index.html) that is used to read and write data to external devices over the serial line. -- `java.nio.ByteBuffer` : a java class that provides access to operations on byte buffers +- `processing.serial.*`: a [Serial Library](https://processing.org/reference/libraries/serial/index.html) that is used to read and write data to external devices over the serial line. +- `java.nio.ByteBuffer`: a java class that provides access to operations on byte buffers ```java import processing.serial.*; import java.nio.ByteBuffer; ``` -Next we initialise the following variables to process the received pixels from the serial port. We set the dimensions, pixel count, and bytes required per frame. +Next we initialize the following variables to process the received pixels from the serial port. We set the dimensions, pixel count, and bytes required per frame. ```java // must match resolution used in the sketch @@ -158,7 +160,7 @@ void draw() { } ``` -### 4. Visualing the Frames +### 4. Visualizing the Frames For this step, you will use the `serialEvent()` callback function to update the `myImage` when a new data is received on the serial port. ```java @@ -243,7 +245,7 @@ Select the right serial port on your IDE and upload the Arduino sketch to your H ## Conclusion -In this tutorial you learnt how to capture the frames from your Vision Shield's Camera and to visualise the frames through Processing. This knowledge can be useful for you to build and experiment simple computer vision applications for both outdoor and indoor environments. +In this tutorial you learnt how to capture the frames from your Vision Shield's Camera and to visualize the frames through Processing. This knowledge can be useful for you to build and experiment simple computer vision applications for both outdoor and indoor environments. ### Complete Sketch The `CaptureRawBytes.ino` Sketch. diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-ard-ttn/content.md b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-ard-ttn/content.md index 6dcab32910..01801676bd 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-ard-ttn/content.md +++ b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-ard-ttn/content.md @@ -21,7 +21,7 @@ This tutorial explains how to connect your Portenta H7 to The Things Network (TT ### Required Hardware and Software -- [Portenta H7 board](https://store.arduino.cc/portenta-h7) +- [Portenta H7](https://store.arduino.cc/portenta-h7) - [Portenta Vision Shield - LoRa®](https://store.arduino.cc/portenta-vision-shield-lora) - [1x Dipole Pentaband antenna](https://store.arduino.cc/antenna) or a UFL Antenna of the H7 - Arduino [offline](https://www.arduino.cc/en/main/software) IDE or Arduino [Web Editor](https://create.arduino.cc/) @@ -91,7 +91,7 @@ Plug the Portenta Vision Shield - LoRa® to the Portenta H7 and them to your PC ![Select port M7 Core](assets/vs_ard_select_port.png) -The LoRa® module on the Vision Shield - LoRa® can be accessed by using the [MKRWAN library](https://github.com/arduino-libraries/MKRWAN)( if you can't find it in your examples list, you can go to **tools > library manager** and type "MKRWAN library" to install it). This library provides all the APIS to communicate with LoRa® and LoRaWAN® networks and can be Installed from the library Manager. The first code you need to upload and run is from the **MKRWAN** library, and its name is **FirstConfiguration**. +The LoRa® module on the Vision Shield - LoRa® can be accessed by using the [MKRWAN library](https://github.com/arduino-libraries/MKRWAN)( if you can't find it in your examples list, you can go to **Tools > Library Manager** and type "MKRWAN library" to install it). This library provides all the APIS to communicate with LoRa® and LoRaWAN® networks and can be Installed from the library Manager. The first code you need to upload and run is from the **MKRWAN** library, and its name is **FirstConfiguration**. ![Upload code to IDE](assets/vs_ard_select_example.png) @@ -141,7 +141,7 @@ Once your board has been registered you can send information to TTN. Let's come - The Application EUI - The App Key. -Lets start by making a connection through the OTAA. Enter "1" in the Serial Monitor input box and press ENTER. Then, find the EUI and the App key from TTN **Device Overview** page. You can read more into OTA vs ABP activation mode at [this link](https://www.thethingsnetwork.org/docs/devices/registration.html) +Lets start by making a connection through the OTAA. Enter "1" in the Serial Monitor input box and press ENTER. Then, find the EUI and the App key from TTN **Device Overview** page. You can read more into OTA vs ABP activation mode [here](https://www.thethingsnetwork.org/docs/devices/registration.html). ``` Your module version is: ARD-078 1.1.9 @@ -160,7 +160,8 @@ Message sent correctly! ## Conclusion If you receive this message, you have managed to configure the Portenta H7 and the Vision Shield - LoRa® on the TTN. - We have retrieved the device EUI, used it to register the device in the TTN console, and programmed the board using the data provided by TTN. Now, we can send data over the LoRa® network which can be viewed from anywhere in the world (as long as we have an Internet connection and our device is in range from a TTN gateway). + +We have retrieved the device EUI, used it to register the device in the TTN console, and programmed the board using the data provided by TTN. Now, we can send data over the LoRa® network which can be viewed from anywhere in the world (as long as we have an Internet connection and our device is in range from a TTN gateway). ### Next Steps diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-openmv-bt/content.md b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-openmv-bt/content.md index c545d9f012..2e6ef36045 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-openmv-bt/content.md +++ b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-openmv-bt/content.md @@ -11,13 +11,15 @@ author: Sebastian Romero In this tutorial you will use the vision carrier board for Portenta to detect the presence and the position of objects in a camera image. For that you will use a technique that is often referred to as blob detection. For this task you will write a MicroPython script and run it on the Portenta with the help of the OpenMV IDE. ## Goals + - How to use the OpenMV IDE to run MicroPython on Portenta - How to use the built-in blob detection algorithm of OpenMV - How to use MicroPython to toggle the built-in LEDs ### Required Hardware and Software -- Portenta H7 board () -- Arduino Portenta Vision Shield - Ethernet (https://store.arduino.cc/products/arduino-portenta-vision-shield-ethernet) + +- [Portenta H7 board](https://store.arduino.cc/portenta-h7) +- [Arduino Portenta Vision Shield - Ethernet](https://store.arduino.cc/products/arduino-portenta-vision-shield-ethernet) - USB C cable (either USB A to USB C or USB C to USB C) - Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ - Portenta Bootloader Version 20+ @@ -54,7 +56,8 @@ Follow the instructions of the installer. ### 2. Flashing the OpenMV Firmware Connect the Portenta to your computer via the USB-C cable if you haven't done so yet. Make sure you first update the bootloader to the latest version using the **STM32H747_updateBootloader** sketch in the examples menu in the Arduino IDE. -Instructions on how to update the bootloader can be found in the ["Updating the Portenta Bootloader" tutorial](https://www.arduino.cc/pro/tutorials/portenta-h7/updating-the-bootloader). + +Instructions on how to update the bootloader can be found in the [Updating the Portenta Bootloader](https://www.arduino.cc/pro/tutorials/portenta-h7/updating-the-bootloader) tutorial. ***In bootloader versions 17 and older there was a bug that could put the Portenta in a boot loop when the transmission aborted while flashing a large firmware file. This was fixed in the bootloader version 18. We strongly advise to update the bootloader before you proceed with the next step of this tutorial!*** @@ -83,7 +86,7 @@ The Portenta will start flashing its blue LED when it's ready to be connected. A In this section you will learn how to use the built-in blob detection algorithm to detect the location of objects in an image. That algorithm allows to detect areas in a digital image that differ in properties such as brightness or color compared to surrounding areas. These areas are called blobs. -To do so you need to feed an image from the camera to the algorithm. It will then analyse it and output the coordinates of the found blobs. You will visualize these coordinates directly on the image and indicate whether a blob was found by using the red and green LED. +To do so you need to feed an image from the camera to the algorithm. It will then analyze it and output the coordinates of the found blobs. You will visualize these coordinates directly on the image and indicate whether a blob was found by using the red and green LED. ### 1. Prepare the Script @@ -141,7 +144,7 @@ The result of that will be visible in the Frame Buffer preview panel on the righ ### 4. Toggling LEDs -What if you want some visual feedback from the blob detection without any computer connected to your Portenta? You could use for example the built-in LEDs to indicate whether or not a blob was found in the camera image. Let's initialise the red and the green LEDs with the following code: +What if you want some visual feedback from the blob detection without any computer connected to your Portenta? You could use for example the built-in LEDs to indicate whether or not a blob was found in the camera image. Let's initialize the red and the green LEDs with the following code: ```python ledRed = pyb.LED(1) # Initiates the red led @@ -224,11 +227,14 @@ Click on the "Play" button at the bottom of the left toolbar. Place some objects In this tutorial you learned how to use the OpenMV IDE to develop MicroPython scripts that then run on the Portenta board. You also learned how to configure the camera of the Vision Carrier board to be used for machine vision applications in OpenMV. Last but not least you learned how to interact with the built-in LEDs in MicroPython on the OpenMV firmware. ### Next Steps + - Familiarize yourself with the OpenMV IDE. There are many other features that didn't get mentioned in this tutorial (e.g. the Serial Terminal). - Try out other machine vision examples that come with the OpenMV IDE (e.g. Face Detection). You can find them in the "Examples" menu. ## Troubleshooting + ### OpenMV Firmware Flashing Issues + - If the upload of the OpenMV firmware fails during the download, put the board back in boot loader mode and try again. Give it a few tries until the firmware gets successfully uploaded. - If the upload of the OpenMV firmware fails without even starting, try uploading the latest firmware using the "Load Specific Firmware File" option. You can find the latest firmware on the [OpenMV Github repository](https://github.com/openmv/openmv/releases). Look for a file called **firmware.bin** in the PORTENTA folder. - 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. diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-openmv-eth/vs-openmv-eth.md b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-openmv-eth/vs-openmv-eth.md index a5ec5c9ac3..155e6f9bc2 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-openmv-eth/vs-openmv-eth.md +++ b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-openmv-eth/vs-openmv-eth.md @@ -20,12 +20,10 @@ software: ## Introduction -With the Ethernet version of the Portenta Vision shield it is possible to connect the board to the Internet using an Ethernet cable. In this tutorial we will go through useful scenarios for using Ethernet and how to connect the board to the Internet with OpenMV. +With the Ethernet version of the Arduino Portenta Vision Shield it is possible to connect the board to the Internet using an Ethernet cable. In this tutorial we will go through useful scenarios for using Ethernet and how to connect the board to the Internet with OpenMV. ## Goals -The goals of this project are: - - Learn how to use the Portenta H7 and Vision Shield Ethernet with a Ethernet cable ### Hardware & Software Needed @@ -46,7 +44,7 @@ Connect the Portenta Vision Shield Ethernet to the Portenta H7. Now connect the ### Programming the Board -After everything is connected, connect the board to OpenMV to install the latest firmware. Once it is connected, we can open the example we are going to upload. In OpenMV go to: **File->Examples->Arduino->Portenta H7->Ethernet->http_client.py**. +After everything is connected, connect the board to OpenMV to install the latest firmware. Once it is connected, we can open the example we are going to upload. In OpenMV go to: **File > Examples > Arduino > Portenta H7 > Ethernet > http_client.py**. ![Where to find the example in OpenMV](assets/vs-eth-openmv-example.png) diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-openmv-fd/content.md b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-openmv-fd/content.md index cd88c110b1..9ad085aa30 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-openmv-fd/content.md +++ b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-openmv-fd/content.md @@ -11,14 +11,16 @@ author: Sebastian Romero, Lenard George In this tutorial you will build a MicroPython application with OpenMV that uses the Portenta Vision Shield to detect faces and overlay them with a custom bitmap image. Think of it as building your own camera filter that puts a smile on every face it detects. This tutorial is based on the face detection example that comes with the OpenMV IDE. ## Goals + - How to use the OpenMV IDE to run MicroPython on Portenta - How to use the built-in face detection algorithm of OpenMV - Copying files to the internal Flash of the Portenta - Using MicroPython to read files from the internal Flash ### Required Hardware and Software -- Portenta H7 board () -- Arduino Portenta Vision Shield (https://store.arduino.cc/portenta-vision-shield) + +- [Portenta H7](https://store.arduino.cc/portenta-h7) +- [Portenta Vision Shield](https://store.arduino.cc/portenta-vision-shield) - USB C cable (either USB A to USB C or USB C to USB C) - Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ - Portenta Bootloader Version 20+ diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-openmv-ml/content.md b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-openmv-ml/content.md index 15b09f1539..5cad1cf0db 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-openmv-ml/content.md +++ b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-openmv-ml/content.md @@ -44,11 +44,13 @@ To train a ML model to classify an image we need to feed it with image data of t The first step is to create a representative dataset of the objects that the ML model is supposed to identify. The key is to have as much diversity in the models as possible. If we show it for example only one specific apple that has a certain size, shape and peel, then it won't be very good at recognizing other apples that look different. This is referred to as a bias and should be avoided as much as possible. In addition you need to teach the model what an apple is not. For that purpose you feed it random image data of things that are not an apple. You could name that class of image data "unknown". If you don't have such a class and the model has only ever seen an apple, it won't know what to do if there is no apple in the image. Creating data sets in OpenMV is simple as there is a built-in function to create them. Before you proceed, connect your Portenta H7 board with the Vision Shield mounted. Click on the connect button in the OpenMV IDE. If you haven't set up your board for OpenMV please consult the [getting started tutorial](https://www.arduino.cc/pro/tutorials/portenta-h7/por-openmv-bt). -Create a new dataset by using the menu command **Tools->Dataset Editor->New Dataset** and name it `Dataset-Fruits`. + +Create a new dataset by using the menu command **Tools > Dataset Editor > New Dataset** and name it `Dataset-Fruits`. ![The Dataset Editor can be found in the Tools menu](assets/vs_openmv_ml_new_dataset.png) The next step is to create image classes. A class represents a unique type of object, in this case the type of fruit. + First, create a new image class and name it `apple` by clicking on "New Class Folder" in the toolbar. Now run the image capturing script that is already open by clicking the play button. Focus the apple with the camera and click on **Capture Data** to snap a picture of it. Capture it from different angles and with different backgrounds to make the recognition later on more robust. Repeat this for other fruits that you would like to classify (e.g. a pear and a banana). Add an `unknown` class and capture some images of different backgrounds that you would like to use during the classification later on. ![The various image classes can be created directly in the dataset editor](assets/vs_openmv_ml_classes.png) @@ -58,7 +60,7 @@ You may have also noticed that there is a labels text file. This file is used to ### 2. Uploading the Data to Edge Impulse Now that all data is ready to be uploaded you need to create a new Edge Impulse project. If you haven't registered an Edge Impulse account yet, you may create one on [their website](https://studio.edgeimpulse.com/login). Log in to the Edge Impulse Studio and create a new project named `Fruit-Detector`. -After that you can go back to the OpenMV IDE and select **Tools->Dataset Editor->Export->Log in to Edge Impulse Account and Upload to Project**. The OpenMV IDE will ask you for your Edge Impulse login credentials. Select the project that you just created and click OK. Leave the data set split setting at the default. This will keep 20% of the images aside for testing the model once it has been trained. That allows you to assess how well your model performs at detecting the objects with data that it hasn't seen yet. +After that you can go back to the OpenMV IDE and select **Tools > Dataset Editor > Export > Log in to Edge Impulse Account and Upload to Project**. The OpenMV IDE will ask you for your Edge Impulse login credentials. Select the project that you just created and click OK. Leave the data set split setting at the default. This will keep 20% of the images aside for testing the model once it has been trained. That allows you to assess how well your model performs at detecting the objects with data that it hasn't seen yet. ![You need to log in with your Edge Impulse account when uploading a dataset for the first time](assets/vs_openmv_ml_edge_impulse_login.png) @@ -72,6 +74,7 @@ Open your project in the Edge Impulse studio and navigate to "Data Acquisition". ### 4. Create an Impulse If you're happy with the data samples you can move on to designing your impulse. An impulse is in a nutshell a recipe with which the model is being trained. It defines actions that are performed on your input data to make them better suited for machine learning and a learning block that defines the algorithm for the classification. In the menu navigate to "Create Impulse" under "Impulse Design" and add an **Image** processing block as well as a **Transfer Learning** learning block. + It's recommended to adjust the image size to 48x48 for improved performance. You can try with higher resolutions but you will notice that the frame rate during the classification will drop significantly. Click on Save Impulse to apply the adjusted settings. ![An Impulse consists of the building blocks needed to train a ML model](assets/vs_openmv_ml_edge_impulse_design.png) @@ -91,6 +94,7 @@ Then click on "Generate Features". The analysis process will take a while to com ### 6. Train the Model Now that the features of your image data are ready to be used for the actual training you can navigate to "Transfer Learning" in the menu. In this example we leave the settings at their default value except of "Number of training cycles" which we increase to 60. This defines how many times the model is being trained. The model gets better with each cycle the same way you get better when learning how to ride a bike and you practice it the first couple of times. + Click on "Start Training" to train the machine learning model. A small amount of images, the **validation set**, are put aside before the training starts to validate the trained model. Not to be confused with the **test set** which can be used to evaluate the final model. Once the training finishes you will see some statistics on how well the model performed during validation. Ideally you get an accuracy of 100% for each object. If you get poor results you may have some images which are not representative of the objects you're trying to classify and should be removed from the data set. ![The confusion matrix shows the accuracy of the ML model after the last training cycle](assets/vs_openmv_ml_edge_impulse_training.png) @@ -130,7 +134,7 @@ The complete script of the classification example is as follows: import sensor, image, time, os, tf sensor.reset() # Reset and initialize the sensor. -sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) +sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240) sensor.set_windowing((240, 240)) # Set 240x240 window. sensor.skip_frames(time=2000) # Let the camera adjust. diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-openmv-ttn/content.md b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-openmv-ttn/content.md index e3e4f07d85..c2b5d3d841 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-openmv-ttn/content.md +++ b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/vs-openmv-ttn/content.md @@ -21,13 +21,13 @@ This tutorial explains how to connect your Portenta H7 to The Things Network (TT ## Required Hardware and Software -- 1 x [Portenta H7 board](https://store.arduino.cc/portenta-h7) -- 1 x [Portenta Vision Shield - LoRa](https://store.arduino.cc/portenta-vision-shield-lora) -- [1x Dipole Pentaband antenna](https://store.arduino.cc/antenna) or a UFL Antenna of the H7 +- [Portenta H7](https://store.arduino.cc/portenta-h7) +- [Portenta Vision Shield - LoRa](https://store.arduino.cc/portenta-vision-shield-lora) +- 1x [Dipole Pentaband antenna](https://store.arduino.cc/antenna) or a UFL Antenna of the H7 - [OpenMV IDE](https://openmv.io/pages/download) - Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ or Arduino CLI 0.13.0+ -- 1 x USB-C cable (either USB-A to USB-C or USB-C to USB-C) -- An [account on The Things Network](https://console.cloud.thethings.network/) +- 1x USB-C cable (either USB-A to USB-C or USB-C to USB-C) +- An account on [The Things Network](https://console.cloud.thethings.network/) ## Instructions @@ -67,7 +67,7 @@ Let's take a closer look at these sections: ### 3. Updating the Modems Firmware -To be able to use the LoRa® functionality, we need to first update the modems firmware through the Arduino IDE. Connect the Portenta and Vision shield to your computer and open the Arduino IDE. The LoRa® module on the Vision Shield can be accessed by using the [MKRWAN library](https://github.com/arduino-libraries/MKRWAN)(if you can't find it in your examples list, you can go to **tools > library manager** and type "MKRWAN library" to install it). This library provides all the APIS to communicate with LoRa® and LoRaWAN® networks and can be installed from the library manager. Select the **Portenta H7 (M7 core)** board in the Arduino IDE, like shown below. +To be able to use the LoRa® functionality, we need to first update the modems firmware through the Arduino IDE. Connect the Portenta and Vision shield to your computer and open the Arduino IDE. The LoRa® module on the Vision Shield can be accessed by using the [MKRWAN library](https://github.com/arduino-libraries/MKRWAN)(if you can't find it in your examples list, you can go to **Tools > Library Manager** and type "MKRWAN library" to install it). This library provides all the APIS to communicate with LoRa® and LoRaWAN® networks and can be installed from the library manager. Select the **Portenta H7 (M7 core)** board in the Arduino IDE, like shown below. ![Select the Arduino Portenta H7 (M7 core) in the board selector.](assets/por_ard_gs_upload_sketch.png) diff --git a/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/cheat-sheet/cheat-sheet.md b/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/cheat-sheet/cheat-sheet.md index 4753b40b09..6f2ff87c4e 100644 --- a/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/cheat-sheet/cheat-sheet.md +++ b/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/cheat-sheet/cheat-sheet.md @@ -85,7 +85,7 @@ int value = analogRead(pin); ### PWM Pins -Most of the digital and analog pins can be used as PWM (Pulse Width Modulation) pins. Check the full pinout in the resources section of the [Nicla Sense ME product page](/hardware/nicla-sense-me)) to see which pins can be used. +Most of the digital and analog pins can be used as PWM (Pulse Width Modulation) pins. Check the full pinout in the resources section of the [Nicla Sense ME product page](/hardware/nicla-sense-me) to see which pins can be used. ```arduino analogWrite(pin, value); @@ -191,7 +191,7 @@ There are three ways to read from the on-board sensors: To read from the sensors in any of these mode, you need to install the **Arduino_BHY2** and **Arduino_BHY2Host** libraries. These can be found in the library manager using the Arduino IDE. To do so in the IDE select **Tools->Manage Libraries...**, now search for **Arduino_BHY2** and **Arduino_BHY2Host** in the new window that opened and click on the install button. -To use the sensors in our sketches, we need to know the sensors ID. You can find them in the section "Sensor IDs" of this article. They can also be found in the header file [here](https://github.com/arduino-libraries/Arduino_BHY2/blob/main/src/sensors/SensorID.h). Additionally, there is an example sketch in the library that will print all available sensors in the serial monitor of the Arduino IDE. This example sketch can be found in **File->Examples->Arduino_BHY2->ShowSensorList** in the Arduino IDE. +To use the sensors in our sketches, we need to know the sensors ID. You can find them in the section "Sensor IDs" of this article. They can also be found in the header file [here](https://github.com/arduino-libraries/Arduino_BHY2/blob/main/src/sensors/SensorID.h). Additionally, there is an example sketch in the library that will print all available sensors in the serial monitor of the Arduino IDE. This example sketch can be found in **File > Examples > Arduino_BHY2 > ShowSensorList** in the Arduino IDE. In the following section you can see how these ID's are used in an Arduino sketch. @@ -635,9 +635,9 @@ In order to transmit data over ESLOV to another Arduino board you need to connec ![Two Arduino boards connected via ESLOV cable](assets/eslov-connection.svg) -1. To have the Nicla Sense ME pass the sensor data through ESLOV you need to upload the **App** sketch. You can find it in the Examples menu in the IDE under **Arduino_BH2 -> App**. After you upload the sketch you can disconnect the Nicla Sense ME from the USB cable. It can be powered through the ESLOV connection. +1. To have the Nicla Sense ME pass the sensor data through ESLOV you need to upload the **App** sketch. You can find it in the Examples menu in the IDE under **Arduino_BH2 > App**. After you upload the sketch you can disconnect the Nicla Sense ME from the USB cable. It can be powered through the ESLOV connection. -1. For the receiving device you need to upload the passthrough sketch. You can find it in the Examples menu in the IDE under **Arduino_BHY2Host -> Passthrough**. After you upload the sketch a separate serial port will be exposed. One port is used for debugging and the other one is used for passing through the sensor data. The latter one is the one you will use for configuring the sensors and reading from them. +1. For the receiving device you need to upload the passthrough sketch. You can find it in the Examples menu in the IDE under **Arduino_BHY2Host > Passthrough**. After you upload the sketch a separate serial port will be exposed. One port is used for debugging and the other one is used for passing through the sensor data. The latter one is the one you will use for configuring the sensors and reading from them. 3. When you're done uploading the sketches you can use the **bhy** script to interact with the sensors. In the downloaded package (see [here](#sensors)) navigate into the tools folder. There you will find binaries of the bhy tool for Linux and Windows. If you like you can build the tool yourself (e.g. if you're on macOS). For that, if you haven't installed **Go** yet, please do so by following [there](https://golang.org/doc/install) instructions. From the terminal execute this command to start the build: `go build` @@ -714,7 +714,7 @@ Use the sensor IDs from the section "Sensor IDs" to enable and configure the des ## BSX Sensor Fusion Software -The BHI260AP sensor runs a customisable firmware based on the BSX Sensor Fusion library. It provides a complete 9-axis fusion solution, which combines the measurements from 3-axis gyroscope, 3-axis geomagnetic sensor and a 3-axis accelerometer to provide a robust absolute orientation vector. The algorithm fuses the sensor raw data from the accelerometer, geomagnetic sensor and gyroscope in an intelligent way to improve each sensor’s output. +The BHI260AP sensor runs a customizable firmware based on the BSX Sensor Fusion library. It provides a complete 9-axis fusion solution, which combines the measurements from 3-axis gyroscope, 3-axis geomagnetic sensor and a 3-axis accelerometer to provide a robust absolute orientation vector. The algorithm fuses the sensor raw data from the accelerometer, geomagnetic sensor and gyroscope in an intelligent way to improve each sensor’s output. Go to this [site](https://www.bosch-sensortec.com/software-tools/software/sensor-fusion-software/) or take a look at the BHI260AP's [datasheet](https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bhi260ap-ds000.pdf) for more information. @@ -826,6 +826,7 @@ Serial1.write("Hello world!"); The BHY2 library for the Nicla Sense ME can automatically send sensor values over a Bluetooth® Low Energy connection to a host board that uses the **Arduino_BHY2Host** library. Include the BHY2Host library at the top of the sketch of the **Host** board. + Configure the sensors the same way as you do with the BHY2 library except of the `begin` function that takes a `NICLA_VIA_BLE` parameter. ```cpp diff --git a/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/cli-tool/content.md b/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/cli-tool/content.md index d1206f3e9a..a1bb1fa072 100644 --- a/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/cli-tool/content.md +++ b/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/cli-tool/content.md @@ -23,20 +23,20 @@ It is possible to configure the Nicla Sense ME to communicate via Serial over US ## Goals -- How to install Go Lang -- How to set up the Nicla Sense ME -- How to use the bhy-controller tool to: configure and read the sensors through the terminal (CLI commands) -- How to use the bhy-controller tool to: run the webserver, configure and read the sensors on your internet browser +- How to install Go Lang +- How to set up the Nicla Sense ME +- How to use the bhy-controller tool to: configure and read the sensors through the terminal (CLI commands) +- How to use the bhy-controller tool to: run the webserver, configure and read the sensors on your internet browser ### Required Hardware and Software -- Nicla Sense ME () -- Nicla Sense ME library (Arduino_BHY2) -- Micro USB-A cable (USB-A to Micro USB-A) -- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ -- Go Lang () -- BHY-CONTROLLER tool -- MKR Board (Only required for DFU) +- [Nicla Sense ME](https://store.arduino.cc/nicla-sense-me) +- Nicla Sense ME library (Arduino_BHY2) +- Micro USB-A cable (USB-A to Micro USB-A) +- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ +- [Go Lang](https://golang.org/) +- BHY-CONTROLLER tool +- MKR Board (Only required for DFU) ***The bhy-controller tool can be downloaded from https://github.com/arduino/nicla-sense-me-fw while the libraries can be obtained via library manager in the Arduino IDE / CLI.*** @@ -51,7 +51,7 @@ First, please go to [Go's download page](https://golang.org/dl/) and follow the ### Set up the Board -First we need to download the library **Arduino_BHY2** in the Arduino IDE. Next we need to upload the **App.ino** example sketch inside the library. This sketch can be found in: **Examples -> Arduino_BHY2 -> App.ino**. Select the sketch and upload it to your board. +First we need to download the library **Arduino_BHY2** in the Arduino IDE. Next we need to upload the **App.ino** example sketch inside the library. This sketch can be found in: **Examples > Arduino_BHY2 > App.ino**. Select the sketch and upload it to your board. ### Use the Bhy-Controller @@ -60,22 +60,25 @@ Open your terminal console and open the directory **tools/bhy-controller/src** w Now to use the tool, the basic **syntax** is introducing the name of the program, `bhy`, followed by the command we want to use, plus its arguments. Once the board is set up and connected we can verify it by using the command: + ```arduino bhy list ``` + Where `bhy` is the program and `list` is the command. This command will print the list of devices connected to the serial ports. After checking that the program works and the Nicla is connected, to configure and read the sensors data we have 2 options: using a WebAPP or the CLI. ### Running the Web App When we run the Web application we are going to connect through Bluetooth® to the Nicla Sense ME and we will configure the sensors inside the browser. This application is going to use WebBLE from your browser. -***For this feature to work, make sure that WebBLE is both supported and enabled! In Google Chrome go to [chrome://flags]() and enable "Experimental Web Platform features". -Check the browser list to confirm that your browser has this feature *** +***For this feature to work, make sure that WebBLE is both supported and enabled! In Google Chrome go to [chrome://flags]() and enable "Experimental Web Platform features". [Check the browser list](https://developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API#browser_compatibility) to confirm that your browser has this feature.*** So let's run the app by going to the directory of the **bhy-controller** app and enter the next command: + ```arduino bhy webserver ``` + This will start a local server hosted at <[localhost:8000](localhost:8000)> Click the button "Open sensor page" and you will see: @@ -95,39 +98,47 @@ To configure the sensor and get the data, enter the sensor ID, e.g Gyroscope is We can set the rate and the latency of each sensor, please check the [Nicla Sense ME Cheat sheet sensor IDs](https://docs.arduino.cc/tutorials/nicla-sense-me/cheat-sheet#sensor-ids) to configure the right one. The syntax for configuring a sensor is: + `bhy sensor config -p -sensor -rate -latency ` For example if we want to configure the **Gyroscope passthrough** which has the sensor ID #**10** connected on the port `COM01` with a rate of 1Hz and a latency of 0ms we would enter: + `bhy sensor config -p /dev/ttyACM2 -sensor 10 -rate 1 -latency 0` Now it's configured to output the reading every second (1Hz). ### Disable If we set the latency and rate to **0** the sensor will be disabled and it will not output any data. + `bhy sensor config -p -sensor -rate 0 -latency 0` ### Read Data From a Sensor If we want to read data from a sensor and print it once, we use: + `bhy sensor read -p ` To do it continuously we add the parameter `-live` + `bhy sensor read -live -p ` ## Using a Passthrough Board with CLI -When we have a firmware for the BHI module or a sketch for the MCU already compiled in a **.bin** file, we can upload them through a MKR or Portenta board directly using the terminal. We need to upload a passthrough sketch to the MKR or Portenta board. Allowing the Nicla to communicate with the computer through the host board. The sketch can be found at **Examples -> Arduino_BHY_HOST -> Passthrough.ino**. +When we have a firmware for the BHI module or a sketch for the MCU already compiled in a **.bin** file, we can upload them through a MKR or Portenta board directly using the terminal. We need to upload a passthrough sketch to the MKR or Portenta board. Allowing the Nicla to communicate with the computer through the host board. The sketch can be found at **Examples > Arduino_BHY_HOST > Passthrough.ino**. We then need to connect the Nicla board to the desired passthrough board with an Eslov cable, or we can mount the Nicla onto the board as a shield. If you wish to mount the Nicla as a shield, take a look at this [tutorial.](./use-as-mkr-shield) Now that we have everything set up, we can use the commands below to upload firmware or a sketch, if they are in the right format. ### Upload a Sketch Syntax for uploading sketch: + `bhy dfu -t nicla -bin -p ` ### Updating Firmware Syntax for uploading firmware: + `bhy dfu -t bhi -bin -p ` ## Conclusion This tutorial shows how to set up the board so it can communicate with both the **Web Application** and the **CLI**. + You also learned the commands to configure, get data from the board with the Web Application and the CLI. We also went through how to launch the Web Application from your terminal. diff --git a/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/connecting-to-iot-cloud/content.md b/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/connecting-to-iot-cloud/content.md index 2ddd770a3b..ef4dbadef6 100644 --- a/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/connecting-to-iot-cloud/content.md +++ b/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/connecting-to-iot-cloud/content.md @@ -30,13 +30,13 @@ In this tutorial you will learn how to upload data from the Nicla module to the ### Required Hardware and Software -- Portenta H7 board -- Nicla sense ME board +- [Portenta H7](https://store.arduino.cc/products/portenta-h7) +- [Nicla Sense ME](https://store.arduino.cc/products/nicla-sense-me) - Eslov cable (included with the Nicla Sense ME) - USB-C to USB-A / C depending on your hardware (Portenta H7) - USB-A to micro USB-A (Nicla Sense ME) -- Wi-fi Access point with access to the internet -- Arduino Create account +- Wi-Fi Access point with access to the internet +- [Arduino Create](https://create.arduino.cc/) account ## Instructions @@ -54,13 +54,13 @@ There are three ways to read from the on-board sensors: 2. Read sensor values through Bluetooth® Low Energy 3. Read sensor values through UART by connecting an ESLOV cable. -For further tips on how to operate the Nicla module check the [cheat sheet.](https://docs.arduino.cc/tutorials/nicla-sense-me/cheat-sheet#sensor-data-over-eslov) +For further tips on how to operate the Nicla module check the [cheat sheet](https://docs.arduino.cc/tutorials/nicla-sense-me/cheat-sheet#sensor-data-over-eslov). ### Client Board (Nicla Sense ME) The **Nicla Sense ME** will be listening to the Host board to send back the required data, this is all automated by the libraries **Arduino_BHY2** and **Arduino_BHY2Host** -The code its available inside the examples provided with the **Arduino_BHY2** Library. Open it by going to **Examples -> Arduino_BHY2 -> App.ino** +The code its available inside the examples provided with the **Arduino_BHY2** Library. Open it by going to **Examples > Arduino_BHY2 > App.ino** This is the code, which initialize the sensors, and maintain the communication @@ -87,13 +87,14 @@ void loop(){ ### Set up the IoT Cloud -To configure the IoT cloud you can follow this [tutorial.](https://docs.arduino.cc/cloud/iot-cloud/tutorials/iot-cloud-getting-started) +To configure the IoT cloud you can follow this [tutorial](content/cloud/iot-cloud/tutorials/iot-cloud-getting-started). + Create a new thing at , we called it "PRO - Portenta and Nicla". You will need to attach the Portenta H7 as a new device to your **Thing setup.** After that go to **Variables** and click the **add** button and select a float variable called **temperature** to store the temperature readings. ![Arduino IoT Cloud - Thing Setup](assets/IoTCloud-thingSetup.png) -***Don't forget to add your Wi-Fi SSID name, and its password (you can do that inside the Thing setup tab) to be able to connect to the Arduino IoT Cloud*** +***Remember to add your Wi-Fi SSID name, and its password (you can do that inside the Thing setup tab) to be able to connect to the Arduino IoT Cloud.*** ### Host Board: Edit the Cloud Sketch @@ -111,11 +112,11 @@ First include the headers that you need and declare the temperature sensor by ad Sensor tempSensor(SENSOR_ID_TEMP); ``` -***You can find all the Sensor IDs at *** +***You can find all the Sensor IDs at .*** Inside `void setup()` initialize the `Serial` communication, configure the variables and configuration for the Arduino IoT Cloud(properties), wait until the **Portenta H7** is connected to the Wi-Fi and IoT Cloud and after that it will setup the communication with the **Nicla Sense ME** and configure the temperature sensor. -***Note: Now we are using "NICLA_VIA_ESLOV". In case you mount it as a shield use "NICLA_AS_SHIELD" as the second parameter of the `begin()` function, or "NICLA_VIA_BLE" if you use Bluetooth® Low Energy*** +***Note: Now we are using "NICLA_VIA_ESLOV". In case you mount it as a shield use "NICLA_AS_SHIELD" as the second parameter of the `begin()` function, or "NICLA_VIA_BLE" if you use Bluetooth® Low Energy.*** ```cpp void setup(){ @@ -149,7 +150,7 @@ Inside `void setup()` initialize the `Serial` communication, configure the varia } ``` -***If you use `yourSensor.begin()` it will be configured the same as with `yourSensor.configure(1,0)`*** +***If you use `yourSensor.begin()` it will be configured the same as with `yourSensor.configure(1,0)`.*** If the Nicla Sense ME shall communicate through Bluetooth® Low Energy, we recommend wrapping `BHY2Host.begin(false, NICLA_VIA_BLE)` in a `while` clause to make sure the connection is established before the sketch continues. @@ -170,6 +171,7 @@ void loop(){ Upload the sketch from the **sketch tab** by clicking the second button at the top left of the left side of the sketch bar. Once it has been uploaded you can see the temperature value that it is being uploaded by going to your **Thing Setup** tab, and looking at the last value of the **temperature**'s value, you can also open the serial monitor to see the live data. ![Arduino IoT Cloud - Sketch tab](assets/IoTCloud-thingSketch.png) + The Sketch: ```arduino @@ -244,10 +246,10 @@ In this tutorial you learned how to upload the temperature values from the Nicla ### Next Steps -- Try to upload other sensor data from he Nicla sense. You can see the available sensors in the [cheat sheet.](https://docs.arduino.cc/tutorials/nicla-sense-me/cheat-sheet#sensor-data-over-eslov) +- Try to upload other sensor data from he Nicla sense. You can see the available sensors in the [cheat sheet](https://docs.arduino.cc/tutorials/nicla-sense-me/cheat-sheet#sensor-data-over-eslov). - Experiment with the dashboard to add more data for a more sophisticated project. ## Troubleshooting -### ArduinoIoT Cloud -If you encounter any issue in the process of using the Arduino IoT Cloud, please visit the IoT Cloud Getting started +### Arduino IoT Cloud +If you encounter any issue in the process of using the Arduino IoT Cloud, please visit the [IoT Cloud Getting started](/content/cloud/iot-cloud/tutorials/iot-cloud-getting-started) diff --git a/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/getting-started/getting-started.md b/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/getting-started/getting-started.md index e760b3b4f4..a3a1575bdd 100644 --- a/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/getting-started/getting-started.md +++ b/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/getting-started/getting-started.md @@ -33,15 +33,15 @@ The goals of this project are: ## Hardware & Software Needed -- Nicla sense ME -- Arduino IDE +- [Nicla Sense ME](https://store.arduino.cc/products/nicla-sense-me) +- [Arduino IDE](https://create.arduino.cc/) - Micro USB cable ## Sensors on the Nicla Sense ME The Nicla Sense ME's BHI sensor includes a 6-axis IMU, we will use this IMU to give us accelerometer and gyroscope readings. An accelerometer is an electromechanical device used to measure acceleration forces. Such forces may be static, like the continuous force of gravity or, as is the case with many mobile devices, dynamic to sense movement or vibrations. A gyroscope sensor can measure and maintain the orientation and angular velocity of an object. Gyroscopes are more advanced than accelerometers, as they can measure the tilt and lateral orientation of an object, whereas an accelerometer can only measure its linear motion. -You can see the full list with all the needed information about the sensors [here.](https://docs.arduino.cc/tutorials/nicla-sense-me/cheat-sheet#sensor-ids) +You can see the full list with all the needed information about the sensors [here](https://docs.arduino.cc/tutorials/nicla-sense-me/cheat-sheet#sensor-ids). ### Sensor Types @@ -76,7 +76,7 @@ The **Arduino_BHY2** library contains these sensors: } ``` -***All of the following Sensor types also have the Sensor functions `value()` and `toString()`*** +***All of the following Sensor types also have the Sensor functions `value()` and `toString()`.*** #### SensorXYZ @@ -173,6 +173,7 @@ The **Arduino_BHY2** library contains these sensors: `getActivity()` - gives you a string with the current activity. This are the activities: + * 0: "Still activity ended" * 1: "Walking activity ended" * 2: "Running activity ended" @@ -191,6 +192,7 @@ This are the activities: * 15: **blank** **Syntax example** + ```arduino #include "Arduino_BHY2.h" @@ -219,9 +221,9 @@ Next we will go through a sketch that allows us to see the readings from the sen ### Arduino IDE and Nicla Core -Start the Arduino IDE and install the **nicla_mbed** core. If you need help with installing the core for the Nicla Sense ME, please refer to this [guide](https://docs.arduino.cc/software/ide-v1/tutorials/getting-started/cores/arduino-mbed_nicla). +Start the Arduino IDE and install the **nicla_mbed** core. If you need help with installing the core for the Nicla Sense ME, please refer to this [guide](/content/software/ide-v1/tutorials/getting-started/cores/arduino-mbed_nicla/). -Now we need to add the **Arduino_BHY2** library that contains the example sketch that we want, we can do this through the library manager in the Arduino IDE. After the library is installed you can access the example sketch directly through the IDE. You can find the sketch in **File->Examples->Arduino_BHY2->Standalone**. Now you can plug in your Nicla Sense ME and upload the sketch. +Now we need to add the **Arduino_BHY2** library that contains the example sketch that we want, we can do this through the library manager in the Arduino IDE. After the library is installed you can access the example sketch directly through the IDE. You can find the sketch in **File > Examples > Arduino_BHY2 > Standalone**. Now you can plug in your Nicla Sense ME and upload the sketch. ![Image of the example in list](assets/nicla-ide-example.png) @@ -271,7 +273,7 @@ After you have uploaded the sketch to the board, open the serial monitor in the ## Next Step -In this sketch we only get the readings of the sensor. A good next step could be to use these readings as parameters to trigger different reactions on the board, with for example the led on the board. Please take a look at our [cheat sheet](https://docs.arduino.cc/tutorials/nicla-sense-me/cheat-sheet) if you want quick references for the boards features. Take a look at the other tutorials we have for the [Nicla Sense ME](https://docs.arduino.cc/hardware/nicla-sense-me#tutorials) to discover more about this board. +In this sketch we only get the readings of the sensor. A good next step could be to use these readings as parameters to trigger different reactions on the board, with for example the led on the board. Please take a look at our [cheat sheet](/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/cheat-sheet) if you want quick references for the boards features. Take a look at the other tutorials we have for the [Nicla Sense ME](https://docs.arduino.cc/hardware/nicla-sense-me#tutorials) to discover more about this board. ## Conclusion diff --git a/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/use-as-mkr-shield/use-as-mkr-shield.md b/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/use-as-mkr-shield/use-as-mkr-shield.md index de3a9d079b..8ed92a70ef 100644 --- a/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/use-as-mkr-shield/use-as-mkr-shield.md +++ b/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/use-as-mkr-shield/use-as-mkr-shield.md @@ -24,6 +24,7 @@ software: --- ## Overview + ![The Arduino Nicla Sense ME mounted on top of the MKR WiFi 1010](assets/hero.png) The form factor of the Nicla Sense allows the board to be used as a MKR shield. In this tutorial we will walk you through converting the Nicla Sense Board into a shield to extend some of the functionalities of the MKR boards using the I2C communications and explain how this communication functions through an example sketch. @@ -34,13 +35,14 @@ The form factor of the Nicla Sense allows the board to be used as a MKR shield. - To establish an I2C communication between the MKRWiFi 1010 and the Nicla Sense ### Required Hardware and Software -- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ -- Arduino MKR WiFi 1010 () -- Arduino Nicla Sense ME () -- 1x USB A Cable to Micro USB -- 2x row of Male Headers (1x9 1x8) -- Soldering tool and Stain. -- Both libraries can be downloaded from the library manager + +- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ +- [MKR WiFi 1010](https://store.arduino.cc/arduino-mkr-wifi-1010) +- [Nicla Sense ME](https://store.arduino.cc/products/nicla-sense-me) +- 1x USB A Cable to Micro USB +- 2x row of Male Headers (1x9 1x8) +- Soldering tool and Stain. +- Both libraries can be downloaded from the library manager ***The following sketches can be found inside the Arduino_BHY2 and Arduino_BHY2Host libraries, available at the library manager, you will need to add the changes shown in this tutorial*** @@ -48,7 +50,7 @@ The form factor of the Nicla Sense allows the board to be used as a MKR shield. ## Instructions ### 1. The Setup -We will need the latest version of the mbed_portenta core to be able to install the needed drivers of the Nicla Sense ME (minimum v2.5.2). Install the **Arduino_BHY2** and **Arduino_BHY2Host** libraries from the library manager. +We will need the latest version of the mbed_portenta core to be able to install the needed drivers of the Nicla Sense ME (minimum v2.5.2). Install the **Arduino_BHY2** and **Arduino_BHY2Host** libraries from the library manager. To convert the Nicla Sense ME into a Shield, you will have to **solder** 2 rows of **headers** one side has 9 pins and the other 8 pins, the long side of the headers needs to be on the **battery connectors side**. @@ -63,13 +65,12 @@ Once the headers are soldered and the board plugged on top of the MKR, it will b ### 2. Structure of the Communication The host (MKR WiFi 1010), will communicate through the **BHY2Host** library with the **Nicla Sense ME** (both devices communicate over I2C) - - ### 3. Host Communication of the MKR WiFi 1010 -To make the host communicate with the Nicla Sense ME which is mounted as a shield you can modify one of the existing examples. Open the sketch under **Examples -> Arduino_BHY2Host -> Accelerometer** and modify the `setup` function. +To make the host communicate with the Nicla Sense ME which is mounted as a shield you can modify one of the existing examples. Open the sketch under **Examples > Arduino_BHY2Host > Accelerometer** and modify the `setup` function. Add the following parameters to `BHY2Host.begin()`: `BHY2Host.begin(false, NICLA_AS_SHIELD);` + The first parameter defines if the data should be passed through the Serial connection. This allows to control the Nicla Sense ME from a PC when connected through a host board. You can use the `arduino-bhy` tool to control the Nicla Sense ME from either the PC command line or from a web page. Full sketch: @@ -105,7 +106,7 @@ void loop() ### 4. Program of the Nicla Sense ME -Program the Nicla Sense ME with the **App.ino** sketch from the **BHY2** library. You can find it under **Examples -> Arduino_BHY2 -> App** . Modify it as follows: +Program the Nicla Sense ME with the **App.ino** sketch from the **BHY2** library. You can find it under **Examples > Arduino_BHY2 > App** . Modify it as follows: Navigate to the `setup` function and add two parameters to `BHY2.begin()` @@ -150,6 +151,7 @@ void loop(){ ## Conclusion This tutorial shows how easy is to access the Nicla Sense ME sensors data and pins if it is plugged as a shield. + The BHY2 Library encapsulates the I2C communication and therefore reduces the complexity of your sketch. diff --git a/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/web-ble-dashboard/content.md b/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/web-ble-dashboard/content.md index 7655de8d57..b3e2fe3890 100644 --- a/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/web-ble-dashboard/content.md +++ b/content/hardware/05.nicla/boards/nicla-sense-me/tutorials/web-ble-dashboard/content.md @@ -35,21 +35,21 @@ In this tutorial we will focus on the version for the Arduino® Nicla Sense ME. ## Goals -- Upload the sketch to the Arduino® Nicla Sense ME. -- Connect through Bluetooth® Low Energy to our dashboard and read sensor data. +- Upload the sketch to the Arduino® Nicla Sense ME. +- Connect through Bluetooth® Low Energy to our dashboard and read sensor data. ### Required Hardware and Software -- [Arduino® Nicla Sense ME](https://store.arduino.cc/products/nicla-sense-me) -- Micro USB-A cable (USB-A to Micro USB-A) -- Arduino IDE 1.8.10+, Arduino IDE 2 or Arduino Web Editor -- If you choose the Arduino IDE, you will need to install 2 libraries: `Arduino_BHY2`and `ArduinoBLE` +- [Nicla Sense ME](https://store.arduino.cc/products/nicla-sense-me) +- Micro USB-A cable (USB-A to Micro USB-A) +- Arduino IDE 1.8.10+, Arduino IDE 2 or Arduino Web Editor +- If you choose the Arduino IDE, you will need to install 2 libraries: `Arduino_BHY2`and `ArduinoBLE` ## Instructions ### Set up the Board -If you use the Web Editor to upload the [sketch](https://create.arduino.cc/editor/pmarquinez/b0102b0a-1d8b-4b4a-a53d-781b896d87f7/preview) you don't need to install any library. They are all included automatically. If you use the Arduino IDE or the CLI: you need to download the **Arduino_BHY2** and the **ArduinoBLE** libraries. +If you use the Web Editor to upload the [sketch](https://create.arduino.cc/editor/pmarquinez/b0102b0a-1d8b-4b4a-a53d-781b896d87f7/preview) you don't need to install any library. They are all included automatically. If you use the Arduino IDE or the CLI: you need to download the **Arduino_BHY2** and the **ArduinoBLE** libraries. If you use a local IDE you can copy & paste the following sketch: ```arduino @@ -284,14 +284,13 @@ To connect your board to the dashboard, you will need to click on the top left b ![Popup message to connect the device to the browser](assets/arduinoAI_Nicla_dashboard_connectDevice.png) -***For this feature to work, make sure that WebBLE is both supported and enabled! In Google Chrome go to and enable "Experimental Web Platform features". -Check the website [compatibility list](https://developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API#browser_compatibility) to confirm that your browser supports this feature*** +***For this feature to work, make sure that WebBLE is both supported and enabled! In Google Chrome go to and enable "Experimental Web Platform features". Check the website [compatibility list](https://developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API#browser_compatibility) to confirm that your browser supports this feature*** Once it's connected, the button will change its color to green, and the graphs will start to show data in real time. Try to rotate the board and see the 3D model of the board spin. -You can also select a different LED colour from the bottom left widget. +You can also select a different LED color from the bottom left widget. Breathe onto the board and see the humidity and temperature values changing. diff --git a/content/hardware/05.nicla/boards/nicla-vision/tutorials/blob-detection/content.md b/content/hardware/05.nicla/boards/nicla-vision/tutorials/blob-detection/content.md index 694215641e..0e3e29b5cd 100644 --- a/content/hardware/05.nicla/boards/nicla-vision/tutorials/blob-detection/content.md +++ b/content/hardware/05.nicla/boards/nicla-vision/tutorials/blob-detection/content.md @@ -10,18 +10,20 @@ author: Sebastian Romero In this tutorial you will use the Arduino® Nicla Vision to detect the presence and the position of objects in a camera image. For that you will use a technique referred to as blob detection. For this task you will write a MicroPython script and run it on the Nicla Vision with the help of the OpenMV IDE. ## Goals + - Learn how to use the OpenMV IDE to run MicroPython on Nicla Vision - Learn how to use the built-in blob detection algorithm of OpenMV - Learn how to use MicroPython to toggle the built-in LEDs ### Required Hardware and Software -- [Nicla Vision board](https://store.arduino.cc/products/nicla-vision) + +- [Nicla Vision](https://store.arduino.cc/products/nicla-vision) - Micro USB cable (either USB A to Micro USB or USB C to Micro USB) - OpenMV IDE 2.6.4+ ## Nicla Vision and the OpenMV IDE -The OpenMV IDE was built for Machine Vision applications. It is meant to provide an Arduino like experience for simple computer vision tasks using a camera sensor. OpenMV comes with its own firmware that is built on MicroPython. Among other hardware it supports the Nicla Vision board. OpenMV allows you to easily preview the camera stream and visually inspect colour ranges to define thresholds for your machine vision scripts. [Here](https://openmv.io/) you can read more about the OpenMV IDE. +The OpenMV IDE was built for Machine Vision applications. It is meant to provide an Arduino like experience for simple computer vision tasks using a camera sensor. OpenMV comes with its own firmware that is built on MicroPython. Among other hardware it supports the Nicla Vision board. OpenMV allows you to easily preview the camera stream and visually inspect color ranges to define thresholds for your machine vision scripts. [Here](https://openmv.io/) you can read more about the OpenMV IDE. ## Instructions @@ -61,7 +63,7 @@ Application Examples: - Detect missing pieces in an assembly line - Detect insect infestation on vegetables -To find blobs you need to feed an image from the camera to the algorithm. It will then analyse it and output the coordinates of the found blobs. You will visualize these coordinates directly on the image and indicate whether a blob was found by using the red and green LED. +To find blobs you need to feed an image from the camera to the algorithm. It will then analyze it and output the coordinates of the found blobs. You will visualize these coordinates directly on the image and indicate whether a blob was found by using the red and green LED. ### 1. Prepare the Script @@ -139,11 +141,11 @@ If you need to know which blob matched which color threshold you can use the `bl The result of that will be visible in the Frame Buffer preview panel on the right side of the OpenMV IDE. -![Visualisation of the blobs in the frame buffer preview](assets/blob_detection_example.png) +![Visualization of the blobs in the frame buffer preview](assets/blob_detection_example.png) ### 5. Toggling LEDs -What if you want some visual feedback from the blob detection without any computer connected to your board? You could use for example the built-in LEDs to indicate whether or not a blob was found in the camera image. Let's initialise the red and the green LEDs with the following code: +What if you want some visual feedback from the blob detection without any computer connected to your board? You could use for example the built-in LEDs to indicate whether or not a blob was found in the camera image. Let's initialize the red and the green LEDs with the following code: ```python ledRed = pyb.LED(1) # Initiates the red led @@ -227,11 +229,14 @@ Click on the "Play" button at the bottom of the left toolbar. Place some objects In this tutorial you learned how to use the OpenMV IDE to develop MicroPython scripts that then run on the Nicla Vision. You also learned how to configure the camera of the Nicla Vision to be used for machine vision applications in OpenMV. Last but not least you learned how to interact with the built-in LEDs in MicroPython on the OpenMV firmware. ### Next Steps + - Familiarize yourself with the OpenMV IDE. There are many other features that didn't get mentioned in this tutorial (e.g. the Serial Terminal). - Try out other machine vision examples that come with the OpenMV IDE. You can find them in the "Examples" menu. ## Troubleshooting + ### OpenMV Firmware Flashing Issues + - If the upload of the OpenMV firmware fails during the download, put the board back in boot loader mode and try again. Give it a few tries until the firmware gets successfully uploaded. - If the upload of the OpenMV firmware fails without even starting, try uploading the latest firmware using the "Load Specific Firmware File" option. You can find the latest firmware on the [OpenMV Github repository](https://github.com/openmv/openmv/releases). Look for a file called **firmware.bin** in the NVISION folder. - If the camera cannot get recognized by the OpenMV IDE or if you see a "No OpenMV Cams found!" message, press the reset button of the board once and wait until you see the blue LED flashing. Then try again connecting to the board. diff --git a/content/hardware/05.nicla/boards/nicla-vision/tutorials/getting-started/content.md b/content/hardware/05.nicla/boards/nicla-vision/tutorials/getting-started/content.md index 21a354d6d1..0848b90e13 100644 --- a/content/hardware/05.nicla/boards/nicla-vision/tutorials/getting-started/content.md +++ b/content/hardware/05.nicla/boards/nicla-vision/tutorials/getting-started/content.md @@ -19,13 +19,15 @@ software: The OpenMV IDE is meant to provide an Arduino like experience for simple machine vision tasks using a camera sensor. In this tutorial, you will learn about some of the basic features of the OpenMV IDE and how to create a simple MicroPython script. The Nicla Vision board has OpenMV firmware on the board by default, making it easy to connect to the OpenMV IDE. ## Goals + - The basic features of the OpenMV IDE - How to create a simple MicroPython script - How to use the OpenMV IDE to run MicroPython on Nicla Vision ### Required Hardware and Software -- [Nicla Vision board](https://store.arduino.cc/products/nicla-vision) + +- [Nicla Vision](https://store.arduino.cc/products/nicla-vision) - Micro USB cable (either USB A to Micro USB or USB C to Micro USB) - OpenMV IDE 2.6.4+ @@ -193,13 +195,15 @@ If you wish to use the board with OpenMV after it has been used with the Arduino In this tutorial you learned how to use the OpenMV IDE with your Nicla Vision board. You also learned how to control the Nicla Vision's RGB LED with MicroPython functions and to upload the script to your board using the OpenMV IDE. ### Next Steps + - 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 > ** in the OpenMV IDE. - It is possible to use the board for more advanced image processing tasks. Be sure to take a look at our other tutorials if you want to learn more. -- Take a look at our other Nicla Vision tutorials which showcase its many uses. You can find them [here](https://docs.arduino.cc/hardware/nicla-vision#tutorials) +- Take a look at our other Nicla Vision tutorials which showcase its many uses. You can find them [here](https://docs.arduino.cc/hardware/nicla-vision#tutorials). ## Troubleshooting ### OpenMV Firmware Flashing Issues + - 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. - 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**. - 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. diff --git a/content/hardware/05.nicla/boards/nicla-vision/tutorials/image-classification/content.md b/content/hardware/05.nicla/boards/nicla-vision/tutorials/image-classification/content.md index b0d9bff323..c07a688c9b 100644 --- a/content/hardware/05.nicla/boards/nicla-vision/tutorials/image-classification/content.md +++ b/content/hardware/05.nicla/boards/nicla-vision/tutorials/image-classification/content.md @@ -50,12 +50,14 @@ To find the right configuration for your application often requires trial and er The first step is to create a representative dataset of the objects that the ML model is supposed to identify. The key is to have as much diversity in the models as possible. If we show it for example only one specific apple that has a certain size, shape and peel, then it won't be very good at recognizing other apples that look different. This is referred to as a bias and should be avoided as much as possible. In addition you need to teach the model what an apple is not. For that purpose you feed it random image data of things that are not an apple. You could name that class of image data "unknown". If you don't have such a class and the model has only ever seen an apple, it won't know what to do if there is no apple in the image. -Creating data sets in OpenMV is simple as there is a built-in function to create them. Before you proceed, connect your Nicla Vision board. Click on the connect button in the OpenMV IDE. If you haven't set up your board for OpenMV please consult the [getting started tutorial](https://docs.arduino.cc/tutorials/nicla-vision/getting-started). -Create a new dataset by using the menu command **Tools->Dataset Editor->New Dataset** and name it `Dataset-Fruits`. +Creating data sets in OpenMV is simple as there is a built-in function to create them. Before you proceed, connect your Nicla Vision board. Click on the connect button in the OpenMV IDE. If you haven't set up your board for OpenMV please consult the [getting started tutorial](.\tutorials\getting-started). + +Create a new dataset by using the menu command **Tools > Dataset Editor > New Dataset** and name it `Dataset-Fruits`. ![The Dataset Editor can be found in the Tools menu](assets/omv_new_dataset.png) The next step is to create image classes. A class represents a unique type of object, in this case the type of fruit. + First, create a new image class and name it `orange` by clicking on "New Class Folder" in the toolbar. Now run the image capturing script that is already open by clicking the play button. Focus the orange with the camera and click on **Capture Data** to snap a picture of it. To conveniently hold the camera with the cable facing down you can use the following lines of code to flip the image accordingly: ```python @@ -69,12 +71,12 @@ sensor.set_hmirror(True) # Mirrors the image horizontally You may have also noticed that there is a labels text file. This file is used to store a textual representation of the classes to later classify the objects and print the class names. The classes are added to that automatically. -***Please note that creating a machine learning model with training data based around just one specific piece of fruit while always using the same background does not create a robust model. It will perform well in the controlled environment but will struggle when being presented with new data*** +***Please note that creating a machine learning model with training data based around just one specific piece of fruit while always using the same background does not create a robust model. It will perform well in the controlled environment but will struggle when being presented with new data.*** ### 2. Uploading the Data to Edge Impulse Now that all data is ready to be uploaded you need to create a new Edge Impulse project. If you haven't registered an Edge Impulse account yet, you may create one on [their website](https://studio.edgeimpulse.com/login). Log in to the Edge Impulse Studio and create a new project named `Fruit-Detector`. -After that you can go back to the OpenMV IDE and select **Tools->Dataset Editor->Export->Log in to Edge Impulse Account and Upload to Project**. The OpenMV IDE will ask you for your Edge Impulse login credentials. Select the project that you just created and click OK. Leave the data set split setting at the default. This will keep 20% of the images aside for testing the model once it has been trained. That allows you to assess how well your model performs at detecting the objects with data that it hasn't seen yet. +After that you can go back to the OpenMV IDE and select **Tools > Dataset Editor > Export > Log in to Edge Impulse Account and Upload to Project**. The OpenMV IDE will ask you for your Edge Impulse login credentials. Select the project that you just created and click OK. Leave the data set split setting at the default. This will keep 20% of the images aside for testing the model once it has been trained. That allows you to assess how well your model performs at detecting the objects with data that it hasn't seen yet. ![You need to log in with your Edge Impulse account when uploading a dataset for the first time](assets/edge_impulse_login.png) @@ -96,6 +98,7 @@ Make sure to have a good training / test data split ratio of around 80/20. The t ### 4. Create an Impulse If you're happy with the data samples you can move on to designing your impulse. An impulse is in a nutshell a recipe with which the model is being trained. It defines actions that are performed on your input data to make them better suited for machine learning and a learning block that defines the algorithm for the classification. In the menu navigate to "Create Impulse" under "Impulse Design" and add an **Image** processing block as well as a **Transfer Learning** learning block. + It's recommended to adjust the image size to 48x48 for improved performance. You can try with higher resolutions but you will notice that the frame rate during the classification will drop significantly. Click on Save Impulse to apply the adjusted settings. ![An Impulse consists of the building blocks needed to train a ML model](assets/ml_edge_impulse_design.png) @@ -119,6 +122,7 @@ Now that the features of your image data are ready to be used for the actual tra ***Choose `MobileNetV2 96x96 0.1` as model type. This will use roughly 200 KB of flash memory. A model with higher ROM usage will likely not fit in the flash!*** In this example we also increased the drop out rate to 0.15 and the output neurons to 12. This increased the accuracy with the given training / test data. You may need to adapt those values based on your own data. + Click on "Start Training" to train the machine learning model. A small amount of images, the **validation set**, are put aside before the training starts to validate the trained model. Not to be confused with the **test set** which can be used to evaluate the final model. Once the training finishes you will see some statistics on how well the model performed during validation. Ideally you get an accuracy of 100% for each object. If you get poor results you may have some images which are not representative of the objects you're trying to classify and should be removed from the data set. ![The confusion matrix shows the accuracy of the ML model after the last training cycle](assets/edge_impulse_training.png) diff --git a/content/hardware/05.nicla/boards/nicla-vision/tutorials/microphone_sensor/content.md b/content/hardware/05.nicla/boards/nicla-vision/tutorials/microphone_sensor/content.md index 403c41c311..acc492d420 100644 --- a/content/hardware/05.nicla/boards/nicla-vision/tutorials/microphone_sensor/content.md +++ b/content/hardware/05.nicla/boards/nicla-vision/tutorials/microphone_sensor/content.md @@ -37,7 +37,7 @@ In this tutorial you will use the **Arduino Nicla Vision** board to get the micr ### Required Hardware and Software -- [Nicla Vision board](https://store.arduino.cc/products/nicla-vision) +- [Nicla Vision](https://store.arduino.cc/products/nicla-vision) - Latest mbed Core version - Latest openMV IDE version @@ -51,7 +51,7 @@ To check that you correctly set up the board please visit our [Getting Started G Open the script by going to **Examples > Arduino > NanoRP2040 > Audio > Audio_fft.py**. -***Using the same sketch as the NanoRP2040, because both boards access the microhpone in the same way*** +***Using the same sketch as the NanoRP2040, because both boards access the microphone in the same way*** Make sure the board is connected, if the board is connected to OpenMV you should see a green play button in the bottom left corner of the window. If you do not see this icon, try pressing the connect button in the bottom left corner. If there still is some issue to connect the board take another look at the getting started guide. diff --git a/content/hardware/05.nicla/boards/nicla-vision/tutorials/nicla-vision-imu/content.md b/content/hardware/05.nicla/boards/nicla-vision/tutorials/nicla-vision-imu/content.md index 435388d827..ff5bf58ceb 100644 --- a/content/hardware/05.nicla/boards/nicla-vision/tutorials/nicla-vision-imu/content.md +++ b/content/hardware/05.nicla/boards/nicla-vision/tutorials/nicla-vision-imu/content.md @@ -34,7 +34,7 @@ The goals of this project are: - Arduino IDE ([online](https://create.arduino.cc/) or [offline](https://www.arduino.cc/en/main/software)). - [LSM6DSOX library](https://github.com/arduino-libraries/Arduino_LSM6DSOX) -- [Nicla Vision board](https://store.arduino.cc/products/nicla-vision) +- [Nicla Vision](https://store.arduino.cc/products/nicla-vision) ## IMU (Inertial Measurement Unit) @@ -74,7 +74,7 @@ float Gx, Gy, Gz; ``` -To initializes the library we need to call `IMU.begin()`. When the IMU is inistialized, we can quickly check the sample rates of the sensors. Calling `IMU.accelerationSampleRate()` and `IMU.gyroscopeSampleRate()` will read the sampling rate of the respective sensor in Hz. +To initializes the library we need to call `IMU.begin()`. When the IMU is initialized, we can quickly check the sample rates of the sensors. Calling `IMU.accelerationSampleRate()` and `IMU.gyroscopeSampleRate()` will read the sampling rate of the respective sensor in Hz. ```arduino void setup() { diff --git a/content/hardware/05.nicla/boards/nicla-vision/tutorials/proximity/content.md b/content/hardware/05.nicla/boards/nicla-vision/tutorials/proximity/content.md index 4a132c8c72..d0fa76f2de 100644 --- a/content/hardware/05.nicla/boards/nicla-vision/tutorials/proximity/content.md +++ b/content/hardware/05.nicla/boards/nicla-vision/tutorials/proximity/content.md @@ -25,15 +25,15 @@ This tutorial goes through how to create a sketch that will blink the built-in R ***The Arduino sketch shown is available inside the `Arduino_Pro_Tutorials` library by going to Examples > Nicla Vision > Proximity_Blink*** ## Goals -The goals of this project are: - - Set up the needed libraries - - Learn how to interact with the proximity readings - - Change the RGB values of the LED + +- Set up the needed libraries +- Learn how to interact with the proximity readings +- Change the RGB values of the LED ### Required Hardware and Software -* [Nicla Vision board](https://store.arduino.cc/products/nicla-vision) -* VL53L1X library (Available in the Library Manager) +- [Nicla Vision](https://store.arduino.cc/products/nicla-vision) +- VL53L1X library (Available in the Library Manager) ## Instructions @@ -72,7 +72,7 @@ int blinkTime = 2000; Inside the setup you need to initialize and configure the proximity sensor. Also the RGB LED needs to be set as an output to make it light up and enable us to change its behavior. -***The LEDs are accessed in the same way as on the Portenta H7: LEDR, LEDG and LEDB*** +***The LEDs are accessed in the same way as on the Portenta H7: LEDR, LEDG and LEDB.*** ```cpp void setup(){ @@ -95,7 +95,7 @@ Inside the setup you need to initialize and configure the proximity sensor. Also } ``` -***Make sure you initialize `Wire1`, set the clock speed to 400kHz and set the bus pointer to `Wire1`, it won't work if you don't add these setting*** +***Make sure you initialize `Wire1`, set the clock speed to 400kHz and set the bus pointer to `Wire1`, it won't work if you don't add these setting.*** ### Control the Speed of the Blink