Skip to main content

Working with App Lab

Arduino App Lab is used to create, run, and manage applications (Apps) on the development board. An App can contain an Arduino Sketch, Python programs, and Bricks functional modules. In computer connection mode, the computer handles editing and management, while the application still runs on the VENTUNO Q.

Download the latest version of App Lab from the Arduino software download page. The App Lab on the computer and the one preinstalled on the development board are updated separately; after connecting the development board, complete the software update according to the on-screen prompts.

PartEditing Location and Purpose
Arduino Sketchsketch/sketch.ino, runs on the STM32 MCU, used for I/O and peripheral control
Pythonpython/main.py, runs on Ubuntu / MPU, used for application logic, networking, and data processing
BricksFunctional modules added as needed, such as Web interface or model processing; basic I/O examples do not require adding AI modules

After completing the Initial Setup and the development board update, you can use App Lab.

Run Example Programs​

  1. Connect and select the VENTUNO Q.
  2. Open an example suitable for this board in "Examples" or "Inspirations", and check the example description and hardware requirements.
  3. Click "Run" in the upper right corner. App Lab will compile the Sketch, transfer the program, and start the application, with the process displayed in the "Console" at the bottom. The first run may require an internet connection to download the runtime environment.
  4. Wait for the startup process to finish, and observe the hardware behavior according to the example description. For getting started, you can use the Blink Example; if the runtime environment download fails, refer to FAQ.

Arduino App Lab Run button, source: Arduino official VENTUNO Q tutorial

Create and Modify an App​

Copy an Official Example​

Built-in examples are read-only content. After opening an example, click "Copy and edit App", enter a new name and select "Create new", then edit the copy.

Create a Blank App​

  1. Select the new creation entry in "Apps"; older interfaces may display it as "My Apps" or "Create new app +".
  2. Enter the application name and create it.
  3. Open sketch/sketch.ino or python/main.py in the file list, and edit the corresponding part as needed. When testing only the MCU, keep the other files generated by the tool.
  4. Click "Run". After modifying code that is running, stop and run again for the new code to take effect.

Arduino App Lab editor and application file list illustration, source: Arduino official App Lab documentation

View the Console and Stop the App​

Console TabWhat to Check
App launchCompilation, transfer, and startup process; some older versions may display it as Start-up
PythonPython print() output and runtime errors
Serial MonitorSketch Serial.print() or Monitor.print() output
Corresponding Brick tabContainer logs that appear when using the corresponding Brick

Arduino App Lab console tabs illustration, source: Arduino official App Lab documentation

During the startup process, only "App launch" may be displayed, and other tabs appear only after startup is complete. If compilation fails, check the launch log first; if the app has started but behaves abnormally, check the Python, serial, or corresponding Brick logs. If the LED is already blinking or the matrix is already displaying, but the launch log is still downloading or shows an error, continue checking the startup process to confirm whether the app has fully started.

Click "Stop" in the upper right corner to stop the app. When you need to input text to the Sketch, send it in the input box at the bottom of "Serial Monitor"; the program can receive it through Serial.read() or Monitor.read().

View the App via the Terminal​

In the development board terminal, you can use the App CLI to view apps:

CommandPurpose
arduino-app-cli app listView created or installed apps
arduino-app-cli app list --examplesView built-in examples
arduino-app-cli app psView the app running status

Basic Function Examples​

Each example creates a separate App and replaces sketch/sketch.ino. View the output in "Serial Monitor".

Disconnect the power before connecting external components, and verify the positions according to this board's pin diagram. The examples use 3.3 V wiring; do not apply 5 V to analog inputs such as A0. For exercises that do not require external components, see Onboard RGB LED and LED Matrix.

Digital I/O: Button-Controlled LED​

Wiring: Prepare a button, an LED, a current-limiting resistor, a breadboard, and jumper wires. Connect as shown in the figure: connect the button to D4 and GND; connect D5 through the current-limiting resistor to the LED anode, and connect the LED cathode to GND. D4 uses an internal pull-up, so it reads LOW when pressed.

VENTUNO Q button and external LED wiring, source: Arduino official MCU tutorial

const int buttonPin = D4;
const int ledPin = D5;

void setup() {
pinMode(buttonPin, INPUT_PULLUP);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}

void loop() {
bool pressed = digitalRead(buttonPin) == LOW;
digitalWrite(ledPin, pressed ? HIGH : LOW);
Serial.println(pressed ? "Button pressed" : "Button released");
delay(100);
}

Running Result: The LED lights up while the button is held down and turns off when released, and the serial port displays the corresponding status. This uses an external button, not the User button on the board.

ADC: Read a Potentiometer​

The ADC (Analog-to-Digital Converter) converts analog voltage into digital readings.

Wiring: Connect the two ends of the potentiometer to 3.3 V and GND respectively, and connect the middle wiper to A0.

VENTUNO Q Potentiometer and A0 Wiring, Source: Arduino Official MCU Tutorial

void setup() {
Serial.begin(9600);
analogReadResolution(12);
}

void loop() {
int value = analogRead(A0);
Serial.println(value);
delay(100);
}

Running Result: When rotating the potentiometer, the serial value changes with the input voltage. This example sets the reading resolution to 12 bits, with a value range of 0 to 4095.

DAC: Output a Fixed Analog Value​

The DAC (Digital-to-Analog Converter) is used to output analog voltage. On this board, DAC0 corresponds to A0, and DAC1 corresponds to A1.

Wiring: First disconnect the potentiometer of the previous ADC example, then use a high-impedance voltage measuring instrument to measure the output of A0 relative to GND.

void setup() {
analogWriteResolution(12);
analogWrite(DAC0, 2048);
}

void loop() {
}

Running Result: A stable analog output is expected to be measured; the actual voltage should be confirmed by measurement. The 12-bit setting has a digital range of 0 to 4095, and 2048 is about half scale. Calling analogWrite() on a regular PWM pin outputs pulses, which cannot be confused with DAC output.

PWM: Adjust the Duty Cycle​

PWM (Pulse Width Modulation) controls the output by changing the proportion of high-level time.

Wiring: Reuse the A0 potentiometer wiring, output PWM on D3; observe D3 and GND with an oscilloscope or logic analyzer.

void setup() {
analogReadResolution(12);
analogWriteResolution(8);
}

void loop() {
int value = analogRead(A0);
int duty = map(value, 0, 4095, 0, 255);
analogWrite(D3, duty);
delay(10);
}

Running Result: When rotating the potentiometer, the duty cycle output on D3 changes. This example sets PWM to 8 bits, corresponding to 0 to 255; do not mix the PWM value range with the ADC reading range.

UART: Send Text​

The hardware serial port on the UNO header uses Serial1, with TX being D1 and RX being D0; Serial is used for App Lab serial output.

Wiring: Connect D1 to the serial receiving end RX that supports 3.3 V logic, and connect GND. Set the receiving end to 115200 baud to view the text. This example only sends data, so D0 does not need to be connected.

void setup() {
Serial1.begin(115200);
}

void loop() {
Serial1.println("Hello VENTUNO Q");
delay(1000);
}

Running Result: The external receiving end receives one line of text about every second. This wiring is not the JCTL debug serial port.

I2C: Select the Bus and Scan Addresses​

The SDA and SCL on the UNO header use Wire; the Qwiic interface uses Wire1.

Wiring: Confirm the module's 3.3 V power supply, GND, SDA, SCL, and the required pull-up conditions, then run the following scanning example.

#include <Wire.h>

// Change to Wire1 to scan the Qwiic interface.
#define SCAN_BUS Wire

void setup() {
Serial.begin(9600);
SCAN_BUS.begin();
}

void loop() {
Serial.println("Scanning I2C...");
for (int address = 0x08; address <= 0x77; address++) {
SCAN_BUS.beginTransmission(address);
if (SCAN_BUS.endTransmission() == 0) {
Serial.print("Found address: 0x");
Serial.println(address, HEX);
}
}
delay(2000);
}

Running Result: When a device responds, the serial port outputs the corresponding I2C address. When connecting multiple devices, be careful to avoid address conflicts.

SPI: Initialization and Wiring​

Wiring: The default UNO SPI pins are D10/SS, D11/MOSI, D12/MISO, and D13/SCK. When connecting peripherals, GND also needs to be connected, and the power supply, clock mode, rate, and chip select level need to be confirmed according to the peripheral documentation.

The following is the initialization code; the chip select is kept high, and no device-related commands are sent for now:

#include <SPI.h>

const int chipSelect = D10;

void setup() {
pinMode(chipSelect, OUTPUT);
digitalWrite(chipSelect, HIGH);
SPI.begin();
}

void loop() {
}

Code Function: The above code completes SPI initialization. When reading from or writing to a peripheral, add the SPI parameters, commands, and data handling specified by the target device in loop().

Python and MCU Communication: Bridge​

Bridge connects Linux and the MCU through Remote Procedure Call (RPC). Below, Python sends an incrementing number, and the MCU outputs it to the serial monitor after receiving it; no external components are required.

VENTUNO Q Bridge Communication Between MPU and MCU, Source: Arduino Official Manual

This example uses the Arduino_RouterBridge. First confirm that the Arduino Zephyr core containing the VENTUNO Q definition is installed, and create this App separately. The Zephyr core version number differs from that of App Lab; if the board definition cannot be found, refer to the FAQ troubleshooting steps.

Sketch (sketch/sketch.ino):

#include "Arduino_RouterBridge.h"

void printValue(int value) {
Monitor.print("MCU received value: ");
Monitor.println(value);
}

void setup() {
Bridge.begin();
Monitor.begin();
Bridge.provide_safe("print_value", printValue);
}

void loop() {
}

Python (python/main.py):

from arduino.app_utils import App, Bridge
import time

counter = 0

def loop():
global counter
time.sleep(2)
counter += 1
Bridge.call("print_value", counter)
print("Sent:", counter)

App.run(user_loop=loop)

After clicking "Run", you should see outputs such as Sent: 1 in "Python", and outputs such as MCU received value: 1 in "Serial Monitor", incrementing about every two seconds.

print_value must be kept consistent on both ends, and the parameter types must also match the C++ function. Here, Bridge.provide_safe() is used so that functions containing Monitor operations execute in a safe context; do not directly change it to a regular Bridge.provide() and then make nested synchronous calls inside the callback.

Set to Run at Startup​

  1. Open an App you created or a copy of an official example.
  2. Click the drop-down arrow next to the app name.
  3. Enable "Run at startup".

Arduino App Lab Set to Run at Startup, Source: Arduino Official VENTUNO Q Manual

After powering on again, check the App logs and hardware behavior to confirm the startup result.