当前位置: 首页 > news >正文

建筑兔零基础Arduino自学记录47|安装和实战小灯闪烁-1

一、安装Arduino

arduino阿丢伊诺官网Arduino - Home

​ 

 安装完毕

 二、安装Mixly米思齐

软件平台 - Let's Mixly!

 

三、注册Tinkercad

这是在没有实体开发板的时候一个替代,免费网站。点击创建电路,即可开始一个项目。
    补充以上一二三步均为基础环境布置。1为官方平台,2为国内自行开发平台,用于图示化编程,3为结合1和2同时解决手边没有实体板的问题。


四、实战Tinkercad——让板子上的灯闪烁

将选取的元件拖入工作区域, 选择喜欢的编辑模式

 我这是是直接把亮灯的样例代码复制进去,点击开始模拟可以看到灯在闪烁

样例代码如下:

/*
  Blink

  Turns an LED on for one second, then off for one second, repeatedly.

  Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
  it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
  the correct LED pin independent of which board is used.
  If you want to know what pin the on-board LED is connected to on your Arduino
  model, check the Technical Specs of your board at:
  https://www.arduino.cc/en/Main/Products

  modified 8 May 2014
  by Scott Fitzgerald
  modified 2 Sep 2016
  by Arturo Guadalupi
  modified 8 Sep 2016
  by Colby Newman

  This example code is in the public domain.

  https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink
*/

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000);                      // wait for a second
  digitalWrite(LED_BUILTIN, LOW);   // turn the LED off by making the voltage LOW
  delay(1000);                      // wait for a second
}

也可以选用这样图示化的编程方式,直接拖拽更改部分内容就可模拟。

相关文章:

  • 91.HarmonyOS NEXT 应用国际化与本地化指南:打造全球化应用
  • 3.16学习总结 java
  • NumPy 函数用法详解:np.full 和 np.concatenate
  • MySQL数据库中的行锁
  • Qt MainWindow简单例子(文本编辑)
  • generallseteter插件生成内容和数据库不一致
  • 基于javaweb的SpringBoot博客商城管理系统设计与实现(源码+文档+部署讲解)
  • dart学习记录2
  • 基于STM32计时秒表设计Proteus仿真+程序+设计报告+原理图PCB+讲解视频
  • python中有几种作用域
  • 传输层自学
  • 配置单区域OSPF实验和报文抓包和分析
  • 51单片机的工作方式
  • 从模型到应用:大语言模型生态系统完全指南
  • 1.Windows+vscode+cline+MCP配置
  • HarmonyOS NEXT开发进阶(十三):网络请求封装
  • 目标:掌握无位置传感器(FOC)控制PMSM的设计与实现
  • 【go】Go 语言中 errors.Is 和 errors.As 的区别
  • RxSwift 学习笔记第三篇之RxSwift的Observer
  • WIN11开发环境变量记录
  • 普京与卢卡申科举行会晤,将扩大在飞机制造等领域合作
  • “即买即退”扩容提质,上海静安推出离境退税2.0版新政
  • 人社部:将制定提前领取个人养老金相关办法
  • 宁夏民政厅原厅长欧阳艳已任自治区政府副秘书长、办公厅主任
  • 法院为“外卖骑手”人身权益撑腰:依法认定实际投保人地位
  • “上海-日喀则”直飞航线正式通航,将于5月1日开启首航