[转] 控制Arduino的利器-Windows Remote Arduino
原文地址:控制Arduino的利器-Windows Remote Arduino
1. 概述
相信很多朋友已经在玩 Arduino了,而且一般都是使用官方的Arduino IDE来写程序控制Arduino硬件。为了能够实现更加方便的控制,微软在Windows IoT计划中推出了Windows Remote Arduino。简单来说,Windows Remote Arduino是一个开源的Windows运行时组件,通过它,我们可以使用蓝牙、USB、WiFi或者是以太网这四种连接方式中的任意一种来控制Arduino硬件。因此,在Windows 10这个统一的大平台下,我们可以使用Windows 10系统的PC、平板、手机,甚至是树莓派等运行IoT Core的设备来控制Arduino硬件。Windows Remote Arduino提供的功能包括:
(1)GPIO控制(模拟和数字)
Digital Write
Digital Read
Analog Write
Analog Read
Setting the pin mode for any pin
Receive events when values change / are reported.
(2)I2C接口通信
(3)Firmata用户自定义协议
2. 上位机环境准备
这里将运行Windows的PC、Surface、或者Windows Phone统称为上位机,我们可以使用以下三种方法中的任意一种来完成上位机的环境设置:
- Download the Windows Remote Arduino Experience app from the Microsoft Store
- Install the NuGet package
- Manually add the Windows Remote Arduino project files to a new Visual Studio solution.
上述三种方式的难以程度依次升高。其中,第一种适用于简单的使用场景,用户无需编写代码就可以通过下载的Windows Remote Arduino Experience来完成Arduino设备的控制。第二种适用于编写自己的UWP应用场景,通过引用Windows Remote Arduino包,在自己编写的程序中完成Arduino设备的控制。第三种需要手动将Windows Remote Arduino源代码工程添加到自己的工程中来,这种方式可以获得的自由度最大,用户可以根据自己的需求定制Windows Remote Arduino。
这里,以第一种方法为例,打开微软商店,直接在PC或者Mobile上安装Windows Remote Arduino Experience应用,该应用是UWP应用。
3. Arduino设置
Windows Remote Arduino建立在Firmata protocol基础之上,因此,我们首先需要在Arduino硬件设备上烧写对应的代码。在安装Arduino IDE的时候,StandardFirmata是默认安装的,用户可以按照以下的步骤进行程序的烧写:
- 通过USB接口连接Arduino设备,这里以Arduino UNO为例。
- 启动Arduino IDE
- 通过Tools > Board和Tools > Port选择对应的板类型和端口号。
- 通过File > Examples > Firmata > StandardFirmata,打开该工程。
- 点击Upload,将StandardFirmata sketch烧写到Arduino UNO中。
如果用户仅仅希望通过USB来控制Arduino设备的话,到这里已经完成了Arduino的设置工作。如果用户希望通过蓝牙来控制Arduino设备,那么,首先,PC上需要有蓝牙模块,其次,Ardunio上也需要连接一个蓝牙模块,具体可以参考这个文章《hook up a Bluetooth device to the Arduino》。另外,如果用户希望通过WiFi来控制Arduino设备,那么,Arduino需要一个WiFi Shield,具体可以参考这个文章《hook up a Wi-Fi device to the Arduino》。
4. PC操作
打开Windows Remote Arduino Experience应用程序,连接类型选择USB,速率选择57600。如果此时Arduino已经正确连接了PC的USB接口,则会自动显示Arduino Uno(COM*),用户只需点击Connect就可以连接Arduino设备了,如下图所示,
之后,应用程序界面分别包含了Digital、 Analog、PWM这三个页面,用户可以点击对应的页面进行远程控制和数据读取。以Pin 13为例,默认是Output的Low,通过点击更改电平,如下图所示。
观察Arduino Uno的板载Pin 13连接的LED灯,即可发现其状态已经点亮,如下图所示。
5. 使用以太网连接
笔者手头有W5100的Ethernet Shield,所以尝试了这种方式。注意,这种方式下,我们需要重新烧写Arduino的sketch。具体步骤如下:
- 登陆Github,下载standard-firmata-networking。
- 解压,拷贝lib目录下的EthernetStream文件夹到本地的Arduino libraries目录。
- 打开standard-firmata-ethernet.ino
- 插上W5100 Ethernet Shield,将Arduino Uno通过USB连接到PC。
- 点击Upload烧写sketch。
烧写完成以后,可以将W5100 Ethernet Shield通过网线连接到TPLink上,查看其自动获得的IP地址,当然,用户也可以修改standard-firmata-ethernet.ino的代码,设置其IP地址。
然后,在PC或者Mobile上打开Windows Remote Arduino Experience应用程序,连接类型选择Network
,速率选择57600。IP地址处填写Arduino获得的IP地址,端口号默认为5000(也可以通过standard-firmata-ethernet.ino进行修改)。
点击连接之后,同样可以按照上面第4节的内容控制Arduino了。
参考链接:
1. http://ms-iot.github.io/content/en-US/win10/WRA.htm
2. Download the Windows Remote Arduino Experience app from the Microsoft Store
4. Manually add the Windows Remote Arduino project files to a new Visual Studio solution
5. hook up a Bluetooth device to the Arduino
6. hook up a Wi-Fi device to the Arduino
7. https://github.com/ms-iot/remote-wiring/
8. https://github.com/ms-iot/remote-wiring/#notes-on-wifi-and-ethernet
[转] 控制Arduino的利器-Windows Remote Arduino的更多相关文章
- 控制Arduino的利器-Windows Remote Arduino
1. 概述 相信很多朋友已经在玩 Arduino了,而且一般都是使用官方的Arduino IDE来写程序控制Arduino硬件.为了能够实现更加方便的控制,微软在Windows IoT计划中推出了Wi ...
- 基于Proteus仿真的Arduino学习(1)——Arduino Uno最小系统及LED的简单使用
一.前言: A.Arduino简介 Arduino是由一个欧洲开发团队于2005年冬季开发.其成员包括Massimo Banzi.David Cuartielles.Tom Igoe.Gianluc ...
- Arduino基础入门篇-进入Arduino的世界
写在前面,首先是发现有网友对Arduino做了介绍,而且介绍比较清晰到位,就引用过来了. 文章出处:https://blog.csdn.net/TonyIOT/article/details/8091 ...
- Windows Remote Shell(WinRM)使用介绍
最近,为了实验我们安装了台Windows Server Core的服务器,没有图形界面的系统总会给人一种很完全的感觉,我们本着安全到底的想法,使用了Windows Remote Shell 的管理方式 ...
- 远程管理服务 Windows Remote Management (WS-Management)
Windows Remote Management (WS-Management) Windows 远程管理(WinRM)服务执行 WS-Management 协议来实现远程管理.WS-Managem ...
- Arduino + RFID 读取 IC 卡 Arduino uno中获得RFID的UID 并通过串口转发RFID卡号
RFID简介:射频识别即RFID(Radio Frequency IDentification)技术,又称无线射频识别,是一种通信技术,可通过无线电讯号识别特定目标并读写相关数据,而无需识别系统与特定 ...
- 短信控制的 智能插头(sim900a arduino uno)
https://www.arduino.cn/thread-19432-1-2.html 1.所需工具:(1)arduino UNO,(2)sim900a模块,(3)单路继电器,(4)220v ac转 ...
- Arduino UNO开发板、Arduino CNC Shield V3.0扩展板、A4988驱动板、grbl固件使用教程
前言 CNC Shield V3.0可用作雕刻机,3D打印机等的驱动扩展板,板上一共有4路步进电机驱动模块的插槽,可驱动4路不进电机,而每一路步进电机都只需要2个IO口,也就是说,6个IO口就可以很好 ...
- 【Arduino】旋转编码器的Arduino使用方法
以前用CRT显示器的时候,调整显示器的时候用一个圆盘转动和点击的方法就可以实现选择菜单和修改设置项的值,比多个按钮的方式方便很多. 鼠标滚轮也是这种操作方法,旋转+点击,只是方向不同.最近在网上买了旋 ...
随机推荐
- Any changes made by a writer will not be seen by other users of the database until the changes have been completed
https://en.wikipedia.org/wiki/Multiversion_concurrency_control Multiversion concurrency control (MCC ...
- android.util.Base64结尾加\n的问题
测试代码,String data,String key. SecretKeySpec signingKey = new SecretKeySpec(key.getBytes(), HMAC_SHA1_ ...
- 学习mysql
一 概述 1.什么是数据库 数据库就是数据的仓库. mysql是对数据库进行存储和指令操作的软件.这类软件成为数据管理系统Database Management System. 2.mysql的安装和 ...
- DevExpress中的ASPxTreeView 递归显示checknodes并获得选中值
aspx代码 <dx:ASPxTreeView ID="ASPxTreeView1" runat="server"> </dx:ASPxTre ...
- Web前端开发规范文档
Web前端开发规范文档 规范目的: 使开发流程更加规范化. 通用规范: TAB键用两个空格代替(windos下tab键占四个空格,linux下TAB键占八个空格). CSS样式属性或者JAVASCRI ...
- 一个简易的dota改键助手
那年,刚开始玩dota的时候, 发现物品栏的快捷键太不好按鸟(集中在小键盘的数字键).于是各种改键工具应运而生,像最经典的warkey, 不知不觉就用了好多年.如今,各种改键工具越来越强大了, 支持各 ...
- composer--------------今天遇到几个奇葩问题,记录一下
1.就是composer跟xdebug有冲突,每次用composer命令的时候都要报xdebug的错误,其实这个只要你去php的配置文件里面将xdebug注释掉就可以了,但是我注释掉了以后还是不行.找 ...
- 旋转toast 自定义toast方向,支持多个方向的显示,自定义View
package com.example.canvasdemo; import java.security.InvalidAlgorithmParameterException; import andr ...
- 单用户模式下连接被占用定位spid
报错The database is in single-user mode, and a user is currently connected to it. 通过 select * from sys ...
- 如何使用Android Studio开发/调试Android源码
本文是以源码中development/tools/idegen/README作为指导文档. 环境: Ubuntu 14.10,openJdk 1.7,Android Studio 1.0.2,andr ...