掌控板3.0
  • 1. 硬件介绍
  • 2. 软件编程(microPython)
  • 3. 示例教程
  • 4. 掌控板3.0玩小智
  • 5. API文档
  • 6. 掌控板C/C++编程
    • 6.1 概述
    • 4.2.1. vscode + PlatformIO
      • 安装VSCode
      • 安装PlatformIO插件
      • 安装Python 3.7+
      • platformIO配置掌控板V3.0
      • 1.新建项目
      • 2.项目结构说明
      • 4.2.1.4 掌控板V3.0示例
        • blink
        • button
    • 4.2.2 arduino IDE
  • 7. 技术支持
  • 版权说明
掌控板3.0
  • 6. 掌控板C/C++编程
  • <no title>
  • 4.2.1. vscode + PlatformIO
  • 4.2.1.4 掌控板V3.0示例
  • blink
  • 查看页面源码

blink

硬件连接

项目创建

按4.2.3节创建项目。

编写代码

示例-main.cpp
 1/*
 2  Blink
 3  Turns an LED on for one second, then off for one second, repeatedly.
 4*/
 5
 6#include <Arduino.h>
 7
 8#define LED_BUILTIN 47 // Define the built-in LED pin, usually pin 13 on most boards
 9
10void setup() {
11  // Initialize digital pin LED_BUILTIN as an output.
12  pinMode(LED_BUILTIN, OUTPUT);
13}
14
15void loop() {
16  digitalWrite(LED_BUILTIN, HIGH);   // Turn the LED on
17  delay(1000);                       // Wait for a second
18  digitalWrite(LED_BUILTIN, LOW);    // Turn the LED off
19  delay(1000);                       // Wait for a second
20}

编译并上传

代码上传后,掌控板会自动运行代码,LED会闪烁。

上一页 下一页

© 版权所有 2025, 深圳盛思科教文化有限公司 www.labplus.cn。

利用 Sphinx 构建,使用的 主题 由 Read the Docs 开发.