• 回复
  • 收藏
  • 点赞
  • 分享
  • 发新帖

【你购物我买单】Arduino Uno Q 试用

前言

前段时间高通收购了 Arduino,同时也发布了 Arduino Uno Q 这款新开发板,区别于以往的 Arduino 开发板,这次的开发版性能非常强劲,外设非常多,已经是妥妥的 SBC 的配置了,下面是官网的介绍

Arduino UNO Q 为 Arduino 生态系统带来了全新的性能层次,融合了高通先进的 Dragonwing™ QRB2210 MPU 运行的完整 Debian Linux 作系统并支持上游的强大计算能力,以及在单板计算机上运行 Arduino 草图的专用 STM32U585 MCU 的实时响应能力。

目前的文档教程基本上都是英文的,不过配图都十分的易懂,下面的官方文档的链接

官方文档链接: docs.arduino.cc/tutorials/uno-q/user-manual/

比如下面的这个示意图,展示了这个开发版的 Pinout,同时也可以看到一个很重要的注意事项,就是 A0 和 A1 一两个银角是没有5V容忍的

硬件介绍

这次电源网和得捷的活动申请了 Arduino UNO Q 这块开发板,很快就到了手中,实物正面如下

底面拍的照片如下

非常的小巧精致,性能也非常强大

软件介绍

对于这块开发板的软件开发可以采用官方提供的 Arduino App Lab 软件进行开发,下载链接如下

arduino.cc/en/software/#app-lab-section

安装好这个软件之后,打开软件会自动扫描是否连接到了 Uno Q 开发板,这里扫描到了 USB 连接到的开发板

第一次使用会有一个软件更新,静候更新即可

准备完成后就进入了这个软件的主页,可以看到有许多的 Example,这里选择 Blink LED with UI 这个 应用进行演示

单击这个 Example 后可以看到打开了工程,工程分成了三个部分,ino 文件用于 STM32U585 的开发、python 脚本文件用于在 MPU 侧的应用开发,这里还用到了 Web UI,所以也有一个简易的 HTML 项目在内

对于 ino 代码文件内容如下

// SPDX-FileCopyrightText: Copyright (C) ARDUINO SRL (http://www.arduino.cc)
//
// SPDX-License-Identifier: MPL-2.0

#include <Arduino_RouterBridge.h>

void setup() {
    pinMode(LED_BUILTIN, OUTPUT);
    // Start with the LED OFF (HIGH state of the PIN)
    digitalWrite(LED_BUILTIN, HIGH);

    Bridge.begin();
    Bridge.provide("set_led_state", set_led_state);
}

void loop() {}

void set_led_state(bool state) {
    // LOW state means LED is ON
    digitalWrite(LED_BUILTIN, state ? LOW : HIGH);
}

这个文件就是一个给bridge暴露出点灯的函数,然后在python代码中,也就是在MPU侧来进行RPC,代码如下

# SPDX-FileCopyrightText: Copyright (C) ARDUINO SRL (http://www.arduino.cc)
#
# SPDX-License-Identifier: MPL-2.0

from arduino.app_utils import *
from arduino.app_bricks.web_ui import WebUI

# Global state
led_is_on = False

def get_led_status():
    """Get current LED status for API."""
    return {
        "led_is_on": led_is_on,
        "status_text": "LED IS ON" if led_is_on else "LED IS OFF"
    }

def toggle_led_state(client, data):
    """Toggle the LED state when receiving socket message."""
    global led_is_on
    led_is_on = not led_is_on

    # Call a function in the sketch, using the Bridge helper library, to control the state of the LED connected to the microcontroller.
    # This performs a RPC call and allows the Python code and the Sketch code to communicate.
    Bridge.call("set_led_state", led_is_on)

    # Send updated status to all connected clients
    ui.send_message('led_status_update', get_led_status())

def on_get_initial_state(client, data):
    """Handle client request for initial LED state."""
    ui.send_message('led_status_update', get_led_status(), client)

# Initialize WebUI
ui = WebUI()

# Handle socket messages (like in Code Scanner example)
ui.on_message('toggle_led', toggle_led_state)
ui.on_message('get_initial_state', on_get_initial_state)

# Start the application
App.run()

前端部分就不多介绍了,实现了一个按键,然后点击 Run 按钮,会全自动的完成一整套的部署流程,包括 ino 代码编译、烧录到 STM32U585 MCU 端、Python 环境搭建并在 MPU 侧运行、开放端口来部署网页,整个流程的 log 如下,十分的详细

然后会自动弹出一个网页,也就是远程控制开发板的红色 LED 的圆形开关

总结

Arduino UNO Q 这款开发板的性能十分的强大,并且在生态方面延续了Arduino 的易用性,在 MCU 端仍使用 ino 也就是 C 代码进行开发、在 MPU 端采用了 Python 代码进行开发,并且搭配 openocd 等工具完成一键式的编译、烧录、部署、运行的整套流程,试用 Arduino UNO Q 这款开发板不禁赞叹 Arduino 和高通团队对于这一款异构多核的 SBC 软硬件易用性方面设计的如此精巧,最后也感谢电源网和得捷的这次活动。

全部回复(0)
正序查看
倒序查看
现在还没有回复呢,说说你的想法