Arduino软件开发环境搭建
简 介: 给出了Arduino开发软件的下载与测试过程。
关键词
: Arduinon,IDE
- Install the Arduino Software (IDE) on Windows PCs
§01 Arduino软件下载安装
1、下载链接
下载的连接
1. Arduino官方网站 ,其中包括 Windows 7下载版本
2. Arduino中文社区下载页面 ,提供了 腾讯微云下载量连接 。
3. CSDN 网站上下载链接: CSDN网站下载链接: 1.8.15 Windows &
从Auduino
官方网站下载到Arduino-1.8.15
安装程序。程序保存在:
D:\Disk\Develop\Arduino\arduino-1.8.15-windows.exe
2、安装Arduino IDE
点击运行Arduino-1.8.15-Windows.exe
,安装缺省配置安装软件。
▲ Arduino安装过程
在安装的后半程,软件提示是否相安装Arduino USB Driver
。同意安装USB driver 软件。
▲ 安装Arduino USB Driver
安装驱动器软件需要联网下载,这个过程需要等待的时间比较长。
▲ Arduino安装完毕
3、首次运行Arduino IDE
在第一次运行Arduino
的过程中,会出现Windows
的防火墙提示,缺省情况下允许访问。
▲ 允许Windows防火墙对于程序的部分功能的阻止
下面是第一次运行Arduino出现的IDE的界面。
▲ Arduino IDE 开发环境
4、建议将界面修改成英文
为了能够与更多的网络资料所叙述的保持一致,建议将Arduino IDE的界面文字修改成英文。可以参考: Arduino IDE显示语言修改 中修改的方式。
▲ 将Arduino的界面修改成英文
§02 连接Arduino硬件
手边有几款Arduino
的硬件版,下面逐一来连接一下测试相应的功能。
1、Grove Beginner Kit
这款硬件版是通过CP2101N
USB
接口芯片与Windows
连接的。
▲ Grove Beginer Kits
使用 MicroUSB 线缆将Arduino连入Windows,在Windows设备管理下的端口中出现 Silicon Labs CP210x USB to UART Bridge(COM7)
。
▲ 连接之后Windows下的虚拟串口
(1)设置开发环境
通过工具菜单栏设置IDE与开发板之间的通讯串口,以及开发板的型号。
- 工具配置:
-
端口
:COM7
开发板
:
开发板
:Arduino_Uno
▲ 设置端口与开发板信息
(2)测试程序
下面的程序是从“文件”菜单中的“示例程序”中自动生成的“Blink without Delay”。 修改其中的:
const long interval=1000
可以修改闪烁LED的频率。单位: ms。
下面是完整的程序。
/*Blink without DelayTurns on and off a light emitting diode (LED) connected to a digital pin,without using the delay() function. This means that other code can run at thesame time without being interrupted by the LED code.The circuit:- Use the onboard LED.- Note: Most Arduinos have an on-board LED you can control. On the UNO, MEGAand ZERO it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTINis 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 yourArduino model, check the Technical Specs of your board at:https://www.arduino.cc/en/Main/Productscreated 2005by David A. Mellismodified 8 Feb 2010by Paul Stoffregenmodified 11 Nov 2013by Scott Fitzgeraldmodified 9 Jan 2017by Arturo GuadalupiThis example code is in the public domain.https://www.arduino.cc/en/Tutorial/BuiltInExamples/BlinkWithoutDelay
*/// constants won't change. Used here to set a pin number:
const int ledPin = LED_BUILTIN;// the number of the LED pin// Variables will change:
int ledState = LOW; // ledState used to set the LED// Generally, you should use "unsigned long" for variables that hold time
// The value will quickly become too large for an int to store
unsigned long previousMillis = 0; // will store last time LED was updated// constants won't change:
const long interval = 200; // interval at which to blink (milliseconds)void setup() {// set the digital pin as output:pinMode(ledPin, OUTPUT);
}void loop() {// here is where you'd put code that needs to be running all the time.// check to see if it's time to blink the LED; that is, if the difference// between the current time and last time you blinked the LED is bigger than// the interval at which you want to blink the LED.unsigned long currentMillis = millis();if (currentMillis - previousMillis >= interval) {// save the last time you blinked the LEDpreviousMillis = currentMillis;// if the LED is off turn it on and vice-versa:if (ledState == LOW) {ledState = HIGH;} else {ledState = LOW;}// set the LED with the ledState of the variable:digitalWrite(ledPin, ledState);}
}
通过“项目”中的**显示项目文件夹(CTRL+K)**可以获得上面测试程序对应的电路原理图以及UNO电路板连接图。
▲ 测试程序对应的配置
(3)编译下载运行
通过项目菜单中的上传(CTRL+U)功能将程序编译上载运行。或者直接点击IDE左上角的 运行“右箭头”按钮。
▲ 运行按钮
说实在的,相比于其它的编译器,Arduino的编译过程显得有点慢,时间长了。
▲ 编译下载运行
下载程序之后,程序便可开始运行了。
▲ 板上的LED闪烁
2、UNO开发板
(1)将开发板接入Windows
UNO 开发板使用的CH340G作为USB与Windows接口,
▲ UNO 开发板
使用USB电缆将UNO开发板接入PC,此时在Windows中出现了 USB-SERIALCH340(COM31)
串口。
▲ 接入系统之后出现的CH340虚拟串口
(2)修改Arduino设置
将Arduino的设置中的端口修改为 COM31,重新下载执行程序。程序执行支撑,
▲ 下载测试程序之后UNO运行情况
3、MEGA2560
(1)将电路板接入Windows
MEGA2560电路板使用MEGA16U作为USB的接口芯片。使用USB线将MEGA2560电路板接入Windows之后,电脑的计算机管理中的设备管理中出现Arduino Mega 2560(COM41) 虚拟串口。
▲ Arduino MEGA
▲ 电脑出现Arduino Mega 2560(COM41) 虚拟串口
(2)修改设置
通过Arduino中的工具中的端口以及开发板选项进行正确的设置。
- Arduino工具设置:
-
开发板
:Arduino_Mega_or_Mega_2560
处理器
:ATMega2560
端口
:COM41(Arduino_Mega)
▲ 对Arduino的开发环境进行设置
按动Ctrl+U将程序重新下载执行。
▲ 下载程序后运行情况
※ 搭建过程总结 ※
本文给出了对于基于Arduino开发环境的IDE的下载安装过程的叙述。并对于手边的三种Arduino的电路板分别进行了测试。
■ 相关文献链接:
- Arduino官方网站
- Windows 7下载版本
- Arduino中文社区下载页面
- 腾讯微云下载量连接
- Install the Arduino Software (IDE) on Windows PCs
- 测试Arduino的基本人机接口
- Grove Beginner Kits基础实验
§* 软件附件
1、修改后的crunpython.py
#!/usr/local/bin/python
# -*- coding: gbk -*-
#============================================================
# CRUNPYTHON.PY -- by Dr. ZhuoQing 2020-01-23
#
# Note:
#============================================================from head import *
from tsmodule.tsstm32 import *altflag = 0
keyread = tspread()
if keyread[9] != 0: altflag = 1#------------------------------------------------------------
ret = tspsendwindowkey('Arduino', "a", control=1)
if ret == 0:tspcopyclipboard()tspsendwindowkey("Arduino", 'vu', control=1)printf('\a')exit()#------------------------------------------------------------
ret = tspsendwindowkey('Project - IAR Embedded Workbench IDE', 'pm', alt=1)if ret != 0:ret = tspsendwindowkey('ImageCraft', 'pm', alt=1)if ret != 0:stm32cmd("CLOSEPORT")tspsendwindowkey('¦ÌVision', 'pb', alt=1)if altflag == 0: tspfocuswindow("TEASOFT:1")time.sleep(3.0)if altflag == 0:stm32cmd("REOPENPORT")else:stm32cmd("REOPENPORTFOCUS")tspfocuswindow("STM32")#------------------------------------------------------------
# END OF FILE : CRUNPYTHON.PY
#============================================================
2、执行arduino命令
#!/usr/local/bin/python
# -*- coding: gbk -*-
#============================================================
# ARD.PY -- by Dr. ZhuoQing 2021-05-24
#
# Note:
#============================================================from head import *arduino_title = "Arduino"#------------------------------------------------------------if len(sys.argv) == 1:tspsendwindowkey(arduino_title, "acv", control=1)tsppasteclipboard()printf('\a')exit()#------------------------------------------------------------if sys.argv[1] == '>':tspcopyclipboard()tspsendwindowkey(arduino_title, "avu", control=1)printf('\a')exit()#------------------------------------------------------------
tspsendwindowkey(arduino_title, "u", control=1)
printf('\a')#------------------------------------------------------------
# END OF FILE : ARD.PY
#============================================================
Arduino软件开发环境搭建相关推荐
- CUDA在Windows下的软件开发环境搭建
http://www.cnblogs.com/yaoyuanzhi/archive/2010/11/13/1876215.html CUDA在Windows下的软件开发环境搭建 本文我们以Visual ...
- 实验二 软件开发环境搭建与 GPIO应用
实验二 软件开发环境搭建与 GPIO应用 相关电路代码文件下载:https://wwe.lanzouw.com/ioorOyxic0h 目录 实验二 软件开发环境搭建与 GPIO应用 一.实验目的 二 ...
- STM32 软件开发环境搭建
无论哪一个单片机环境的搭建均包括三部分:程序开发编译调试程序(MDK).驱动程序.下载至单片机的程序 下载地址:链接:https://pan.baidu.com/s/1zSE6ie6sp844bTPf ...
- FFmpeg windows软件开发环境搭建
FFmpeg说明 FFmpeg是一个自由软件,可以运行音频和视频多种格式的录影.转换.流功能1,包含了libavcodec ─这是一个用于多个项目中音频和视频的×××库,以及libavformat-- ...
- Android软件开发环境搭建
步骤一:下载并安装JDK (Java SE Development Kit) 由于Android SDK和Eclipse都是用Java编写的,因此需要先在Windows 7上安装JDK,JDK可按以 ...
- DA14580软件开发环境搭建
KEIL开发环境有两个需要软件包需要配置. 第一部分是CMSIS 第二部分是SDK 通过CMSI和SDK的一层层的封装,包装,目的就是为了user更简单,好用. 就像STM32编程的库函数版本,和寄存 ...
- DSP TMS320C6000基础学习(3)——CCS v5软件开发环境搭建
================================================== DSP CCS工程文件构成 =================================== ...
- 软件开发环境搭建系列之sublime text的相关配置(九)
文章目录 一.st的获取及安装 1.1.st获取 二.st安装 2.1.下载说明部分 2.2.st的激活 三.安装插件管理工具 3.1.st插件管理工具Package Control 3.2.st的界 ...
- 无线红外探测器03-环境搭建及程序详解
一.红外探测器需要实现的主要功能: 红外报警检测 电池低压检测 防拆开关检测 OOK无线发射 设备低功耗设计 二.搭建软件开发环境 本产品的主控芯片是STC15W204S. 1. Keil软件的安装 ...
最新文章
- pytorch中查看gpu信息
- Web设计和开发人员有用的15Chrome插件
- 大家都能读懂的IT生活枕边书
- Hadoop应用实战100讲(一)-Hadoop进行文件压缩
- 架构和产品的制衡——说说竞价拍卖那点事
- AR-关于几种特殊的收款方式说明
- Android 系统性能优化(41)---Android代码内存优化建议-OnTrimMemory优化
- html5连接mysql数据库操作_html5-本地数据库的操作
- Java接受带文件的表单,Javaweb使用getPart来接收表单文件
- D3D处理2D图像: NV12格式及其转换(1)
- 最好用的数据分析软件jmp16中文版
- 扫码枪收银有手续费吗_生意好时最怕收银出故障,这几个扫码枪的常见问题你一定要知道...
- Eclipse的Maven创建
- 论文的每一页最上方都有一条横线(word2007)
- 每天五分钟机器学习:如何计算模型的假阳性率和真阳性率?
- 有了字节流,为什么还要有字符流
- python开发中级_针对中级Python开发人员的13个项目构想
- 消息称Bilibili通过发行债券和股票筹集8.24亿美元
- Greenplum 内存与负载管理(resource queue)最佳实践
- C语言打印心型 爱心搬砖